{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {
    "ExecuteTime": {
     "end_time": "2019-02-16T05:10:26.525703Z",
     "start_time": "2019-02-16T05:10:26.080235Z"
    },
    "collapsed": true,
    "hide_input": false
   },
   "outputs": [],
   "source": [
    "import torch\n",
    "import torch.nn as nn\n",
    "import torch.nn.functional as F\n",
    "from torch.autograd import Variable\n",
    "from torch.optim.lr_scheduler import StepLR\n",
    "from torch.utils.data import DataLoader,TensorDataset\n",
    "import torch.utils.data as data\n",
    "import numpy as np\n",
    "import scipy.io as sio\n",
    "import math\n",
    "import argparse\n",
    "import random\n",
    "import os\n",
    "from tensorboardX import SummaryWriter"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {
    "ExecuteTime": {
     "end_time": "2019-02-16T05:10:26.529041Z",
     "start_time": "2019-02-16T05:10:26.526686Z"
    },
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "BATCH_SIZE = 64\n",
    "EPISODE = 500000\n",
    "TEST_EPISODE = 1000\n",
    "LEARNING_RATE =1e-5\n",
    "Nom = 1e-5\n",
    "Weight_Deacy = 1e-5\n",
    "GPU = 0\n",
    "Margin = 1"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {
    "ExecuteTime": {
     "end_time": "2019-02-16T05:10:28.562525Z",
     "start_time": "2019-02-16T05:10:26.530196Z"
    }
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "init dataset\n",
      "----------------------------------------------------------------------------------------------------\n"
     ]
    }
   ],
   "source": [
    "print(\"init dataset\")\n",
    "##################################参数##################################################################\n",
    "dataroot = '../data'\n",
    "dataset = 'AwA1_data'\n",
    "image_embedding = 'res101'               #ResNet101层\n",
    "class_embedding = 'original_att'         #属性表达 85-d\n",
    "#######################################读取视觉特征###################################################################\n",
    "\n",
    "matcontent = sio.loadmat(dataroot + \"/\" + dataset + \"/\" + image_embedding + \".mat\")  #scipy loadmat\n",
    " \n",
    "feature = matcontent['features'].T         #转置 30478x2048 每一行是一个完整的样本\n",
    "\n",
    "label = matcontent['labels'].astype(int).squeeze() - 1   #matlab begin 1 ,numpy begin 0\n",
    "########################################读取属性特征###########################################################\n",
    "\n",
    "matcontent = sio.loadmat(dataroot + \"/\" + dataset + \"/\" + class_embedding + \"_splits.mat\")\n",
    "\n",
    "    \n",
    "# numpy array index starts from 0, matlab starts from 1\n",
    "trainval_loc = matcontent['trainval_loc'].squeeze() - 1    #squeeze()去掉维度中的1 AxBx1 --->AxB\n",
    "\n",
    "test_seen_loc = matcontent['test_seen_loc'].squeeze() - 1\n",
    "test_unseen_loc = matcontent['test_unseen_loc'].squeeze() - 1\n",
    "\n",
    "attribute = matcontent['att'].T    #转置 50x85 每行是整个属性向量\n",
    "\n",
    "x = feature[trainval_loc]                      # train_features trainval里面是图片的编号 begin with 0 ，19832个\n",
    "train_label = label[trainval_loc].astype(int)  # train_label  int类型没变 每个图片的lable 19832个\n",
    "train_id = np.unique(train_label)\n",
    "\n",
    "att = attribute[train_label]                   # train attributes 每个图片的属性 19832个\n",
    "\n",
    "########################add negative pairs#######################\n",
    "#x_negative = np.empty_like(x)\n",
    "#x_negative_label = np.empty_like(train_label)\n",
    "#print(x.shape[0])\n",
    "\n",
    "#for i in range(x.shape[0]):\n",
    "#    pick=np.random.choice(np.where(train_label[i]!=train_id)[0], replace=True)\n",
    "#    x_negative[i] = x[pick]\n",
    "#    x_negative_label[i] = train_label[pick]\n",
    "    \n",
    "x_test = feature[test_unseen_loc]                   # test_feature 5685个\n",
    "test_label = label[test_unseen_loc].astype(int)     # test_label   5685个\n",
    "\n",
    "x_test_seen = feature[test_seen_loc]                #test_seen_feature 4958个\n",
    "test_label_seen = label[test_seen_loc].astype(int)  # test_seen_label  4958个\n",
    "    \n",
    "test_id = np.unique(test_label)                     # test_id  10个类 ，unique去重\n",
    "att_pro = attribute[test_id]                        # test_attribute 每一类的属性向量 10x85\n",
    "\n",
    "# train set\n",
    "train_features = torch.from_numpy(x)   #np-->tensor\n",
    "#train_fearures_negative = torch.from_numpy(x_negative)\n",
    "\n",
    "sample_attributes=[]\n",
    "train_label = torch.from_numpy(train_label).unsqueeze(1) #每张图片的属性转化 ，unsqueeze(1)就是插入到第一维度 AxB维-->Ax1xB\n",
    "#train_negative_label = torch.from_numpy(x_negative_label).unsqueeze(1)\n",
    "# attributes\n",
    "all_attributes = np.array(attribute)  #所有50类属性转变为numpy数组???属性向量仍然用的numpy类型 没有转化为pytorch\n",
    "#print(all_attributes)\n",
    "    \n",
    "#print('-'*50)\n",
    "attributes = torch.from_numpy(attribute) \n",
    "#print(attribute)\n",
    "# test set\n",
    "\n",
    "test_features = torch.from_numpy(x_test)\n",
    "#print(test_features.shape)\n",
    "\n",
    "test_label = torch.from_numpy(test_label).unsqueeze(1)\n",
    "#print(test_label.shape)\n",
    "\n",
    "testclasses_id = np.array(test_id)\n",
    "#print(testclasses_id.shape)\n",
    "\n",
    "test_attributes = torch.from_numpy(att_pro).float()\n",
    "#print(test_attributes.shape)\n",
    "\n",
    "test_seen_features = torch.from_numpy(x_test_seen)\n",
    "#print(test_seen_features.shape)\n",
    "\n",
    "test_seen_label = torch.from_numpy(test_label_seen)\n",
    "\n",
    "train_data = TensorDataset( train_label, train_features )\n",
    "#train_data = TensorDataset(train_label, train_features, train_fearures_negative)\n",
    "\n",
    "#################here need new code to make triplet data#####################\n",
    "print('-'*100)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {
    "ExecuteTime": {
     "end_time": "2019-02-16T05:10:28.565749Z",
     "start_time": "2019-02-16T05:10:28.563533Z"
    },
    "collapsed": true,
    "hide_input": false
   },
   "outputs": [],
   "source": [
    "from my_net_3 import AttributeNetwork\n",
    "from my_net_3 import TripletNetwork\n",
    "from my_net_3 import MetricNetwork"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {
    "ExecuteTime": {
     "end_time": "2019-02-16T05:10:30.112438Z",
     "start_time": "2019-02-16T05:10:28.566600Z"
    },
    "hide_input": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "init networks\n",
      "----------------------------------------------------------------------------------------------------\n"
     ]
    }
   ],
   "source": [
    "# init network\n",
    "print(\"init networks\")\n",
    "attribute_network = AttributeNetwork(85,1024,2048)  #85d属性 1024隐藏层 2048输出 85d到2048d\n",
    "metric_network = MetricNetwork(2048,1024,2048)\n",
    "triplet_network = TripletNetwork(metric_network)  #metric learning   \n",
    "triplet_network.cuda(GPU)\n",
    "attribute_network.cuda(GPU)\n",
    "metric_network.cuda(GPU)\n",
    "#attribute_network_optim = torch.optim.Adam(attribute_network.parameters(), lr=LEARNING_RATE, weight_decay=1e-5)\n",
    "#优化器adam 学习率 正则1e-5\n",
    "\n",
    "#attribute_network_scheduler = StepLR(attribute_network_optim, step_size=200000, gamma=0.5)\n",
    "#学习率每200k步 乘0.5\n",
    "triplet_network_optim = torch.optim.Adam(triplet_network.parameters(), lr=LEARNING_RATE,weight_decay=Weight_Deacy)\n",
    "#\n",
    "attribute_network_optim=torch.optim.Adam(attribute_network.parameters(), lr=LEARNING_RATE,weight_decay=Weight_Deacy)\n",
    "#triplet_network_optim = torch.optim.SGD(triplet_network.parameters(), lr=LEARNING_RATE,momentum=0.9 , \n",
    "#                                         weight_decay=Weight_Deacy)\n",
    "triplet_network_scheduler = StepLR(triplet_network_optim , step_size=200000 , gamma=0.5)\n",
    "attribute_network_scheduler = StepLR(attribute_network_optim , step_size=200000 , gamma=0.5)\n",
    "#\n",
    "print('-'*100)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {
    "ExecuteTime": {
     "end_time": "2019-02-16T05:10:30.120618Z",
     "start_time": "2019-02-16T05:10:30.113863Z"
    },
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "def compute_accuracy_per_class(test_features, test_label, test_id, test_attributes):\n",
    "    \n",
    "    test_data = TensorDataset(test_features, test_label)\n",
    "    test_batch = 32\n",
    "    test_loader = DataLoader(test_data, batch_size=test_batch, shuffle=False)\n",
    "    total_rewards = 0\n",
    "    #print(test_features.size())\n",
    "    sample_labels = test_id\n",
    "    sample_attributes = test_attributes\n",
    "    class_num = sample_attributes.shape[0]\n",
    "    test_size = test_features.shape[0]\n",
    "    per_class_num = np.zeros(class_num)\n",
    "    per_class_true= np.zeros(class_num)\n",
    "\n",
    "    print(\"class num:\", class_num)\n",
    "\n",
    "    for batch_features,batch_labels in test_loader:\n",
    "\n",
    "        batch_size = batch_labels.shape[0]\n",
    "        batch_features_ext = torch.from_numpy(batch_features.numpy().repeat(class_num, 0))\n",
    "        batch_features_ext = metric_network(Variable(batch_features_ext).cuda(GPU).float()) # 32*1024\n",
    "\n",
    "\n",
    "        sample_features = metric_network(attribute_network(Variable(sample_attributes).cuda(GPU).float()))\n",
    "        sample_features_ext = sample_features.repeat(batch_size, 1)\n",
    "\n",
    "\n",
    "        relations = F.pairwise_distance(batch_features_ext, sample_features_ext).view(-1, class_num)\n",
    "        #relations = F.cos(batch_features_ext, sample_features_ext).view(-1, class_num)\n",
    "        re_batch_labels = []\n",
    "        for label in batch_labels.numpy():\n",
    "            index = np.argwhere(sample_labels == label)\n",
    "            re_batch_labels.append(index[0][0])\n",
    "        re_batch_labels_id, batch_per_num = np.unique(re_batch_labels , return_counts=True) \n",
    "        re_batch_labels = torch.cuda.LongTensor(re_batch_labels)\n",
    "        \n",
    "        for each in range(re_batch_labels_id.size):\n",
    "            #print(re_batch_labels_id[each])\n",
    "            #print(batch_per_num[each])\n",
    "            per_class_num[re_batch_labels_id[each]] = per_class_num[re_batch_labels_id[each]] + batch_per_num[each]\n",
    "        #print(re_batch_labels_id)\n",
    "        #print('-'*100)\n",
    "        #print(batch_per_num)\n",
    "        #print('-'*100)\n",
    "\n",
    "\n",
    "        _, predict_labels = torch.min(relations.data, 1)\n",
    "        for j in range(batch_size):\n",
    "            if predict_labels[j] == re_batch_labels[j]:\n",
    "                per_class_true[re_batch_labels[j]] = per_class_true[re_batch_labels[j]] + 1\n",
    "            \n",
    "        \n",
    "        \n",
    "        #rewards = [1 if predict_labels[j] == re_batch_labels[j] else 0 for j in range(batch_size)]\n",
    "        #total_rewards += np.sum(rewards)\n",
    "    per_accuracy = per_class_true[np.nonzero(per_class_num)] / per_class_num[np.nonzero(per_class_num)]\n",
    "    \n",
    "    test_accuracy = np.sum(per_accuracy)/1.0/np.count_nonzero(per_class_num)\n",
    "    #print(np.count_nonzero(per_class_num))\n",
    "    return  test_accuracy"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {
    "ExecuteTime": {
     "end_time": "2019-02-16T08:47:39.543480Z",
     "start_time": "2019-02-16T05:10:30.121914Z"
    },
    "code_folding": [],
    "scrolled": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "training...\n",
      "episode: 1000 loss tensor(0.0822, device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.281125653521848\n",
      "gzsl: unseen=0.1416 , seen=0.5142 , h=0.2221\n",
      "____________________________________________________________________________________________________\n",
      "episode: 2000 loss tensor(0.1358, device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.19111838658590402\n",
      "gzsl: unseen=0.1460 , seen=0.5629 , h=0.2319\n",
      "____________________________________________________________________________________________________\n",
      "episode: 3000 loss tensor(0.1078, device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.19657854601827754\n",
      "gzsl: unseen=0.1541 , seen=0.6685 , h=0.2504\n",
      "____________________________________________________________________________________________________\n",
      "episode: 4000 loss tensor(0.0246, device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.272945450722602\n",
      "gzsl: unseen=0.0665 , seen=0.7258 , h=0.1218\n",
      "____________________________________________________________________________________________________\n",
      "episode: 5000 loss tensor(0.0102, device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.23530234206872486\n",
      "gzsl: unseen=0.0810 , seen=0.7773 , h=0.1467\n",
      "____________________________________________________________________________________________________\n",
      "episode: 6000 loss tensor(0.0084, device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.27512354514812337\n",
      "gzsl: unseen=0.0310 , seen=0.7882 , h=0.0597\n",
      "____________________________________________________________________________________________________\n",
      "episode: 7000 loss tensor(0., device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.2920214771212012\n",
      "gzsl: unseen=0.0306 , seen=0.7221 , h=0.0587\n",
      "____________________________________________________________________________________________________\n",
      "episode: 8000 loss tensor(0., device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.42701903708992334\n",
      "gzsl: unseen=0.0192 , seen=0.7720 , h=0.0374\n",
      "____________________________________________________________________________________________________\n",
      "episode: 9000 loss tensor(0.0959, device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.4117272055502978\n",
      "gzsl: unseen=0.0051 , seen=0.7877 , h=0.0102\n",
      "____________________________________________________________________________________________________\n",
      "episode: 10000 loss tensor(0.0053, device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.45045633134848495\n",
      "gzsl: unseen=0.0052 , seen=0.7835 , h=0.0103\n",
      "____________________________________________________________________________________________________\n",
      "episode: 11000 loss tensor(0., device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.4334958644426067\n",
      "gzsl: unseen=0.0093 , seen=0.8174 , h=0.0184\n",
      "____________________________________________________________________________________________________\n",
      "episode: 12000 loss tensor(0.0201, device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.4208410991717405\n",
      "gzsl: unseen=0.0550 , seen=0.8529 , h=0.1034\n",
      "____________________________________________________________________________________________________\n",
      "episode: 13000 loss tensor(0.0511, device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.46255384843580777\n",
      "gzsl: unseen=0.0101 , seen=0.8123 , h=0.0199\n",
      "____________________________________________________________________________________________________\n",
      "episode: 14000 loss tensor(0.0191, device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.4281900488316233\n",
      "gzsl: unseen=0.0378 , seen=0.8469 , h=0.0723\n",
      "____________________________________________________________________________________________________\n",
      "episode: 15000 loss tensor(0.0215, device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.5162972376979155\n",
      "gzsl: unseen=0.0291 , seen=0.8460 , h=0.0562\n",
      "____________________________________________________________________________________________________\n",
      "episode: 16000 loss tensor(0., device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.4460969273446128\n",
      "gzsl: unseen=0.0370 , seen=0.8221 , h=0.0708\n",
      "____________________________________________________________________________________________________\n",
      "episode: 17000 loss tensor(0.0041, device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.42321301961613134\n",
      "gzsl: unseen=0.0197 , seen=0.8534 , h=0.0385\n",
      "____________________________________________________________________________________________________\n",
      "episode: 18000 loss tensor(0., device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.44455344296250365\n",
      "gzsl: unseen=0.0564 , seen=0.8563 , h=0.1058\n",
      "____________________________________________________________________________________________________\n",
      "episode: 19000 loss tensor(0.0094, device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.5248069781206468\n",
      "gzsl: unseen=0.0117 , seen=0.8461 , h=0.0232\n",
      "____________________________________________________________________________________________________\n",
      "episode: 20000 loss tensor(0., device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.5412711940485933\n",
      "gzsl: unseen=0.0357 , seen=0.8678 , h=0.0686\n",
      "____________________________________________________________________________________________________\n",
      "episode: 21000 loss tensor(0., device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.5049428032155212\n",
      "gzsl: unseen=0.0558 , seen=0.8611 , h=0.1048\n",
      "____________________________________________________________________________________________________\n",
      "episode: 22000 loss tensor(0., device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.4991845323385803\n",
      "gzsl: unseen=0.0752 , seen=0.8625 , h=0.1384\n",
      "____________________________________________________________________________________________________\n",
      "episode: 23000 loss tensor(0., device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.4942100271039931\n",
      "gzsl: unseen=0.0515 , seen=0.8488 , h=0.0971\n",
      "____________________________________________________________________________________________________\n",
      "episode: 24000 loss tensor(0., device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.5134607932265054\n",
      "gzsl: unseen=0.0304 , seen=0.8391 , h=0.0586\n",
      "____________________________________________________________________________________________________\n",
      "episode: 25000 loss tensor(0.0340, device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.4611160015937342\n",
      "gzsl: unseen=0.1023 , seen=0.8472 , h=0.1825\n",
      "____________________________________________________________________________________________________\n",
      "episode: 26000 loss tensor(0.0529, device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.5131056519904069\n",
      "gzsl: unseen=0.0767 , seen=0.8793 , h=0.1411\n",
      "____________________________________________________________________________________________________\n",
      "episode: 27000 loss tensor(0., device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.5092518219036088\n",
      "gzsl: unseen=0.1273 , seen=0.8437 , h=0.2212\n",
      "____________________________________________________________________________________________________\n",
      "episode: 28000 loss tensor(0.0247, device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.5170946244612488\n",
      "gzsl: unseen=0.1260 , seen=0.8683 , h=0.2201\n",
      "____________________________________________________________________________________________________\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "episode: 29000 loss tensor(0., device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.5242948893746698\n",
      "gzsl: unseen=0.1228 , seen=0.8430 , h=0.2143\n",
      "____________________________________________________________________________________________________\n",
      "episode: 30000 loss tensor(0.0294, device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.5100631289367954\n",
      "gzsl: unseen=0.1086 , seen=0.8566 , h=0.1928\n",
      "____________________________________________________________________________________________________\n",
      "episode: 31000 loss tensor(0.0262, device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.4719094900348539\n",
      "gzsl: unseen=0.1179 , seen=0.8579 , h=0.2074\n",
      "____________________________________________________________________________________________________\n",
      "episode: 32000 loss tensor(0.0051, device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.492822498014558\n",
      "gzsl: unseen=0.1383 , seen=0.8625 , h=0.2384\n",
      "____________________________________________________________________________________________________\n",
      "episode: 33000 loss tensor(0., device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.46129929592304275\n",
      "gzsl: unseen=0.1727 , seen=0.8548 , h=0.2874\n",
      "____________________________________________________________________________________________________\n",
      "episode: 34000 loss tensor(0.0229, device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.5096057549409958\n",
      "gzsl: unseen=0.1309 , seen=0.8666 , h=0.2275\n",
      "____________________________________________________________________________________________________\n",
      "episode: 35000 loss tensor(0.0024, device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.4887832240567711\n",
      "gzsl: unseen=0.1507 , seen=0.8697 , h=0.2569\n",
      "____________________________________________________________________________________________________\n",
      "episode: 36000 loss tensor(0.0378, device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.5410559614200806\n",
      "gzsl: unseen=0.1408 , seen=0.8535 , h=0.2417\n",
      "____________________________________________________________________________________________________\n",
      "episode: 37000 loss tensor(0., device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.5298296599128627\n",
      "gzsl: unseen=0.1399 , seen=0.8870 , h=0.2417\n",
      "____________________________________________________________________________________________________\n",
      "episode: 38000 loss tensor(0.0080, device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.5386276170810376\n",
      "gzsl: unseen=0.1281 , seen=0.8580 , h=0.2229\n",
      "____________________________________________________________________________________________________\n",
      "episode: 39000 loss tensor(0.0116, device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.5190902735698633\n",
      "gzsl: unseen=0.1412 , seen=0.8554 , h=0.2423\n",
      "____________________________________________________________________________________________________\n",
      "episode: 40000 loss tensor(0., device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.49732477532850916\n",
      "gzsl: unseen=0.1970 , seen=0.8671 , h=0.3210\n",
      "____________________________________________________________________________________________________\n",
      "episode: 41000 loss tensor(0., device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.5660666210072558\n",
      "gzsl: unseen=0.1794 , seen=0.8679 , h=0.2974\n",
      "____________________________________________________________________________________________________\n",
      "episode: 42000 loss tensor(0.0353, device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.5724199913277788\n",
      "gzsl: unseen=0.1792 , seen=0.8554 , h=0.2964\n",
      "____________________________________________________________________________________________________\n",
      "episode: 43000 loss tensor(0., device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.488166349796577\n",
      "gzsl: unseen=0.1458 , seen=0.8557 , h=0.2491\n",
      "____________________________________________________________________________________________________\n",
      "episode: 44000 loss tensor(0., device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.556963824931547\n",
      "gzsl: unseen=0.2018 , seen=0.8777 , h=0.3282\n",
      "____________________________________________________________________________________________________\n",
      "episode: 45000 loss tensor(0., device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.5036978810140523\n",
      "gzsl: unseen=0.1930 , seen=0.8642 , h=0.3155\n",
      "____________________________________________________________________________________________________\n",
      "episode: 46000 loss tensor(0., device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.5460685401074702\n",
      "gzsl: unseen=0.1843 , seen=0.8531 , h=0.3031\n",
      "____________________________________________________________________________________________________\n",
      "episode: 47000 loss tensor(0.0686, device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.5525627692205488\n",
      "gzsl: unseen=0.2388 , seen=0.8729 , h=0.3750\n",
      "____________________________________________________________________________________________________\n",
      "episode: 48000 loss tensor(0., device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.5288638701844903\n",
      "gzsl: unseen=0.2484 , seen=0.8660 , h=0.3861\n",
      "____________________________________________________________________________________________________\n",
      "episode: 49000 loss tensor(0.0003, device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.5463793906088622\n",
      "gzsl: unseen=0.1812 , seen=0.8647 , h=0.2997\n",
      "____________________________________________________________________________________________________\n",
      "episode: 50000 loss tensor(0., device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.552207689489362\n",
      "gzsl: unseen=0.2241 , seen=0.8686 , h=0.3563\n",
      "____________________________________________________________________________________________________\n",
      "episode: 51000 loss tensor(0., device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.5529095642698723\n",
      "gzsl: unseen=0.2449 , seen=0.8604 , h=0.3812\n",
      "____________________________________________________________________________________________________\n",
      "episode: 52000 loss tensor(0., device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.5284943692481696\n",
      "gzsl: unseen=0.2375 , seen=0.8665 , h=0.3729\n",
      "____________________________________________________________________________________________________\n",
      "episode: 53000 loss tensor(0., device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.5415346737592934\n",
      "gzsl: unseen=0.2207 , seen=0.8640 , h=0.3516\n",
      "____________________________________________________________________________________________________\n",
      "episode: 54000 loss tensor(0.0025, device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.5409304644282977\n",
      "gzsl: unseen=0.2644 , seen=0.8430 , h=0.4025\n",
      "____________________________________________________________________________________________________\n",
      "episode: 55000 loss tensor(0., device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.537198848743657\n",
      "gzsl: unseen=0.2463 , seen=0.8550 , h=0.3825\n",
      "____________________________________________________________________________________________________\n",
      "episode: 56000 loss tensor(0., device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.5803782683513816\n",
      "gzsl: unseen=0.2585 , seen=0.8579 , h=0.3972\n",
      "____________________________________________________________________________________________________\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "episode: 57000 loss tensor(0., device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.5529712892706778\n",
      "gzsl: unseen=0.2484 , seen=0.8646 , h=0.3859\n",
      "____________________________________________________________________________________________________\n",
      "episode: 58000 loss tensor(0., device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.5503402282023918\n",
      "gzsl: unseen=0.2721 , seen=0.8381 , h=0.4109\n",
      "____________________________________________________________________________________________________\n",
      "episode: 59000 loss tensor(0.0079, device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.5310009771674862\n",
      "gzsl: unseen=0.2173 , seen=0.8560 , h=0.3466\n",
      "____________________________________________________________________________________________________\n",
      "episode: 60000 loss tensor(0.0306, device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.563095809968609\n",
      "gzsl: unseen=0.2599 , seen=0.8433 , h=0.3973\n",
      "____________________________________________________________________________________________________\n",
      "episode: 61000 loss tensor(0., device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.5501895323538231\n",
      "gzsl: unseen=0.2934 , seen=0.8588 , h=0.4374\n",
      "____________________________________________________________________________________________________\n",
      "episode: 62000 loss tensor(0., device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.5550113372636665\n",
      "gzsl: unseen=0.2593 , seen=0.8531 , h=0.3978\n",
      "____________________________________________________________________________________________________\n",
      "episode: 63000 loss tensor(0.0181, device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.5039167853553399\n",
      "gzsl: unseen=0.2911 , seen=0.8474 , h=0.4333\n",
      "____________________________________________________________________________________________________\n",
      "episode: 64000 loss tensor(0., device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.5665911594697903\n",
      "gzsl: unseen=0.3109 , seen=0.8264 , h=0.4518\n",
      "____________________________________________________________________________________________________\n",
      "episode: 65000 loss tensor(0., device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.5323517300339882\n",
      "gzsl: unseen=0.3064 , seen=0.8386 , h=0.4488\n",
      "____________________________________________________________________________________________________\n",
      "episode: 66000 loss tensor(0.0532, device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.5078652201053683\n",
      "gzsl: unseen=0.2873 , seen=0.8414 , h=0.4283\n",
      "____________________________________________________________________________________________________\n",
      "episode: 67000 loss tensor(0., device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.5643013691722457\n",
      "gzsl: unseen=0.2970 , seen=0.8586 , h=0.4414\n",
      "____________________________________________________________________________________________________\n",
      "episode: 68000 loss tensor(0., device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.5646412226668167\n",
      "gzsl: unseen=0.3254 , seen=0.8494 , h=0.4706\n",
      "____________________________________________________________________________________________________\n",
      "episode: 69000 loss tensor(0., device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.5335340014601504\n",
      "gzsl: unseen=0.2722 , seen=0.8416 , h=0.4113\n",
      "____________________________________________________________________________________________________\n",
      "episode: 70000 loss tensor(0., device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.5022749172615851\n",
      "gzsl: unseen=0.3183 , seen=0.8295 , h=0.4600\n",
      "____________________________________________________________________________________________________\n",
      "episode: 71000 loss tensor(0., device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.5296460825517706\n",
      "gzsl: unseen=0.2858 , seen=0.8660 , h=0.4298\n",
      "____________________________________________________________________________________________________\n",
      "episode: 72000 loss tensor(0., device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.5215486100353719\n",
      "gzsl: unseen=0.3181 , seen=0.8376 , h=0.4611\n",
      "____________________________________________________________________________________________________\n",
      "episode: 73000 loss tensor(0., device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.5115790416744412\n",
      "gzsl: unseen=0.2580 , seen=0.8188 , h=0.3924\n",
      "____________________________________________________________________________________________________\n",
      "episode: 74000 loss tensor(0., device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.5803554676760208\n",
      "gzsl: unseen=0.3203 , seen=0.8293 , h=0.4621\n",
      "____________________________________________________________________________________________________\n",
      "episode: 75000 loss tensor(0., device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.5130922740366325\n",
      "gzsl: unseen=0.3008 , seen=0.8497 , h=0.4443\n",
      "____________________________________________________________________________________________________\n",
      "episode: 76000 loss tensor(0.0179, device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.5325058929098553\n",
      "gzsl: unseen=0.3022 , seen=0.8335 , h=0.4435\n",
      "____________________________________________________________________________________________________\n",
      "episode: 77000 loss tensor(0.0063, device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.5151768136481656\n",
      "gzsl: unseen=0.3203 , seen=0.8407 , h=0.4638\n",
      "____________________________________________________________________________________________________\n",
      "episode: 78000 loss tensor(0., device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.5252327222788391\n",
      "gzsl: unseen=0.2843 , seen=0.8274 , h=0.4231\n",
      "____________________________________________________________________________________________________\n",
      "episode: 79000 loss tensor(0., device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.5193746984033275\n",
      "gzsl: unseen=0.2709 , seen=0.8356 , h=0.4091\n",
      "____________________________________________________________________________________________________\n",
      "episode: 80000 loss tensor(0., device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.555558089355319\n",
      "gzsl: unseen=0.3491 , seen=0.8428 , h=0.4937\n",
      "____________________________________________________________________________________________________\n",
      "episode: 81000 loss tensor(0.0335, device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.5275291257193566\n",
      "gzsl: unseen=0.2943 , seen=0.8362 , h=0.4354\n",
      "____________________________________________________________________________________________________\n",
      "episode: 82000 loss tensor(0., device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.547191428354418\n",
      "gzsl: unseen=0.3403 , seen=0.8429 , h=0.4849\n",
      "____________________________________________________________________________________________________\n",
      "episode: 83000 loss tensor(0., device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.5525286084096511\n",
      "gzsl: unseen=0.3705 , seen=0.8294 , h=0.5122\n",
      "____________________________________________________________________________________________________\n",
      "episode: 84000 loss tensor(0.0145, device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.5107777964953198\n",
      "gzsl: unseen=0.3370 , seen=0.8251 , h=0.4785\n",
      "____________________________________________________________________________________________________\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "episode: 85000 loss tensor(0.0362, device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.5362740077461645\n",
      "gzsl: unseen=0.3780 , seen=0.8257 , h=0.5186\n",
      "____________________________________________________________________________________________________\n",
      "episode: 86000 loss tensor(0., device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.52695904911373\n",
      "gzsl: unseen=0.3612 , seen=0.8249 , h=0.5024\n",
      "____________________________________________________________________________________________________\n",
      "episode: 87000 loss tensor(0.0026, device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.5299741709053489\n",
      "gzsl: unseen=0.3463 , seen=0.8213 , h=0.4872\n",
      "____________________________________________________________________________________________________\n",
      "episode: 88000 loss tensor(0., device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.509216220919805\n",
      "gzsl: unseen=0.3155 , seen=0.8211 , h=0.4559\n",
      "____________________________________________________________________________________________________\n",
      "episode: 89000 loss tensor(0., device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.5482716919566009\n",
      "gzsl: unseen=0.3444 , seen=0.8218 , h=0.4854\n",
      "____________________________________________________________________________________________________\n",
      "episode: 90000 loss tensor(0., device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.5421630891450455\n",
      "gzsl: unseen=0.3707 , seen=0.8299 , h=0.5125\n",
      "____________________________________________________________________________________________________\n",
      "episode: 91000 loss tensor(0.0076, device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.5131412322134181\n",
      "gzsl: unseen=0.3375 , seen=0.8333 , h=0.4804\n",
      "____________________________________________________________________________________________________\n",
      "episode: 92000 loss tensor(0., device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.503514312322985\n",
      "gzsl: unseen=0.3395 , seen=0.8116 , h=0.4788\n",
      "____________________________________________________________________________________________________\n",
      "episode: 93000 loss tensor(0., device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.5056391742663248\n",
      "gzsl: unseen=0.3362 , seen=0.8022 , h=0.4738\n",
      "____________________________________________________________________________________________________\n",
      "episode: 94000 loss tensor(0., device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.5320995153673035\n",
      "gzsl: unseen=0.3815 , seen=0.8150 , h=0.5197\n",
      "____________________________________________________________________________________________________\n",
      "episode: 95000 loss tensor(0., device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.5205454907732399\n",
      "gzsl: unseen=0.3820 , seen=0.8115 , h=0.5195\n",
      "____________________________________________________________________________________________________\n",
      "episode: 96000 loss tensor(0., device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.5093296081196519\n",
      "gzsl: unseen=0.3414 , seen=0.8110 , h=0.4805\n",
      "____________________________________________________________________________________________________\n",
      "episode: 97000 loss tensor(0., device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.5506711106815003\n",
      "gzsl: unseen=0.3866 , seen=0.8080 , h=0.5230\n",
      "____________________________________________________________________________________________________\n",
      "episode: 98000 loss tensor(0., device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.5594021123881527\n",
      "gzsl: unseen=0.3738 , seen=0.8252 , h=0.5145\n",
      "____________________________________________________________________________________________________\n",
      "episode: 99000 loss tensor(0., device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.559929275508536\n",
      "gzsl: unseen=0.3604 , seen=0.8325 , h=0.5030\n",
      "____________________________________________________________________________________________________\n",
      "episode: 100000 loss tensor(0., device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.5524133573237868\n",
      "gzsl: unseen=0.3714 , seen=0.8228 , h=0.5118\n",
      "____________________________________________________________________________________________________\n",
      "episode: 101000 loss tensor(0.0146, device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.5444870082999576\n",
      "gzsl: unseen=0.3539 , seen=0.8259 , h=0.4955\n",
      "____________________________________________________________________________________________________\n",
      "episode: 102000 loss tensor(0.0137, device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.5776457143061793\n",
      "gzsl: unseen=0.3655 , seen=0.8235 , h=0.5063\n",
      "____________________________________________________________________________________________________\n",
      "episode: 103000 loss tensor(0., device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.5837785152603713\n",
      "gzsl: unseen=0.3636 , seen=0.8285 , h=0.5054\n",
      "____________________________________________________________________________________________________\n",
      "episode: 104000 loss tensor(0.0165, device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.5693738167797089\n",
      "gzsl: unseen=0.3687 , seen=0.8447 , h=0.5133\n",
      "____________________________________________________________________________________________________\n",
      "episode: 105000 loss tensor(0., device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.5866520341833958\n",
      "gzsl: unseen=0.3519 , seen=0.8391 , h=0.4958\n",
      "____________________________________________________________________________________________________\n",
      "episode: 106000 loss tensor(0., device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.5563914533727063\n",
      "gzsl: unseen=0.3364 , seen=0.8241 , h=0.4778\n",
      "____________________________________________________________________________________________________\n",
      "episode: 107000 loss tensor(0., device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.6009851838820784\n",
      "gzsl: unseen=0.3762 , seen=0.8291 , h=0.5175\n",
      "____________________________________________________________________________________________________\n",
      "episode: 108000 loss tensor(0., device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.5439964044341188\n",
      "gzsl: unseen=0.3408 , seen=0.8118 , h=0.4801\n",
      "____________________________________________________________________________________________________\n",
      "episode: 109000 loss tensor(0., device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.5826283699683859\n",
      "gzsl: unseen=0.3984 , seen=0.8216 , h=0.5366\n",
      "____________________________________________________________________________________________________\n",
      "episode: 110000 loss tensor(0., device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.6091979620885107\n",
      "gzsl: unseen=0.4704 , seen=0.8131 , h=0.5960\n",
      "____________________________________________________________________________________________________\n",
      "episode: 111000 loss tensor(0., device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.5871795394399053\n",
      "gzsl: unseen=0.3940 , seen=0.8265 , h=0.5336\n",
      "____________________________________________________________________________________________________\n",
      "episode: 112000 loss tensor(0., device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.6048697036701121\n",
      "gzsl: unseen=0.4121 , seen=0.8301 , h=0.5508\n",
      "____________________________________________________________________________________________________\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "episode: 113000 loss tensor(0., device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.604536885999571\n",
      "gzsl: unseen=0.4410 , seen=0.8202 , h=0.5736\n",
      "____________________________________________________________________________________________________\n",
      "episode: 114000 loss tensor(0., device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.5866966711280599\n",
      "gzsl: unseen=0.3984 , seen=0.8194 , h=0.5361\n",
      "____________________________________________________________________________________________________\n",
      "episode: 115000 loss tensor(0., device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.6176702559553476\n",
      "gzsl: unseen=0.4637 , seen=0.8033 , h=0.5880\n",
      "____________________________________________________________________________________________________\n",
      "episode: 116000 loss tensor(0., device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.5673761141982243\n",
      "gzsl: unseen=0.3777 , seen=0.8319 , h=0.5195\n",
      "____________________________________________________________________________________________________\n",
      "episode: 117000 loss tensor(0., device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.5496209699018643\n",
      "gzsl: unseen=0.3783 , seen=0.8113 , h=0.5159\n",
      "____________________________________________________________________________________________________\n",
      "episode: 118000 loss tensor(0., device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.5547898660430374\n",
      "gzsl: unseen=0.4035 , seen=0.8123 , h=0.5392\n",
      "____________________________________________________________________________________________________\n",
      "episode: 119000 loss tensor(0., device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.5289009629368138\n",
      "gzsl: unseen=0.3297 , seen=0.8174 , h=0.4699\n",
      "____________________________________________________________________________________________________\n",
      "episode: 120000 loss tensor(0., device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.5380290477014811\n",
      "gzsl: unseen=0.3716 , seen=0.8121 , h=0.5099\n",
      "____________________________________________________________________________________________________\n",
      "episode: 121000 loss tensor(0., device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.5890182171225111\n",
      "gzsl: unseen=0.4249 , seen=0.8163 , h=0.5589\n",
      "____________________________________________________________________________________________________\n",
      "episode: 122000 loss tensor(0., device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.5698021895530929\n",
      "gzsl: unseen=0.3967 , seen=0.8103 , h=0.5326\n",
      "____________________________________________________________________________________________________\n",
      "episode: 123000 loss tensor(0., device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.5478075165770644\n",
      "gzsl: unseen=0.4227 , seen=0.7976 , h=0.5526\n",
      "____________________________________________________________________________________________________\n",
      "episode: 124000 loss tensor(0., device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.5161980957984524\n",
      "gzsl: unseen=0.3539 , seen=0.8019 , h=0.4911\n",
      "____________________________________________________________________________________________________\n",
      "episode: 125000 loss tensor(0.0212, device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.5540851869303947\n",
      "gzsl: unseen=0.3852 , seen=0.8213 , h=0.5245\n",
      "____________________________________________________________________________________________________\n",
      "episode: 126000 loss tensor(0., device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.5695473676782163\n",
      "gzsl: unseen=0.4163 , seen=0.8198 , h=0.5522\n",
      "____________________________________________________________________________________________________\n",
      "episode: 127000 loss tensor(0., device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.5868728768528347\n",
      "gzsl: unseen=0.4161 , seen=0.8156 , h=0.5511\n",
      "____________________________________________________________________________________________________\n",
      "episode: 128000 loss tensor(0., device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.5683985918006649\n",
      "gzsl: unseen=0.4209 , seen=0.8147 , h=0.5551\n",
      "____________________________________________________________________________________________________\n",
      "episode: 129000 loss tensor(0., device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.5791192531491853\n",
      "gzsl: unseen=0.4107 , seen=0.8121 , h=0.5455\n",
      "____________________________________________________________________________________________________\n",
      "episode: 130000 loss tensor(0., device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.5572712933643662\n",
      "gzsl: unseen=0.4175 , seen=0.8069 , h=0.5503\n",
      "____________________________________________________________________________________________________\n",
      "episode: 131000 loss tensor(0., device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.5827390289474896\n",
      "gzsl: unseen=0.4054 , seen=0.8146 , h=0.5414\n",
      "____________________________________________________________________________________________________\n",
      "episode: 132000 loss tensor(0., device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.572004920787653\n",
      "gzsl: unseen=0.4119 , seen=0.8155 , h=0.5473\n",
      "____________________________________________________________________________________________________\n",
      "episode: 133000 loss tensor(0., device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.5827434470391888\n",
      "gzsl: unseen=0.4093 , seen=0.8169 , h=0.5454\n",
      "____________________________________________________________________________________________________\n",
      "episode: 134000 loss tensor(0., device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.5624515655397337\n",
      "gzsl: unseen=0.4162 , seen=0.8197 , h=0.5521\n",
      "____________________________________________________________________________________________________\n",
      "episode: 135000 loss tensor(0., device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.544479678440128\n",
      "gzsl: unseen=0.3788 , seen=0.7991 , h=0.5139\n",
      "____________________________________________________________________________________________________\n",
      "episode: 136000 loss tensor(0., device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.5734730583075512\n",
      "gzsl: unseen=0.4022 , seen=0.8271 , h=0.5412\n",
      "____________________________________________________________________________________________________\n",
      "episode: 137000 loss tensor(0., device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.56937326497495\n",
      "gzsl: unseen=0.3866 , seen=0.8140 , h=0.5243\n",
      "____________________________________________________________________________________________________\n",
      "episode: 138000 loss tensor(0., device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.5498938044302987\n",
      "gzsl: unseen=0.4078 , seen=0.7924 , h=0.5384\n",
      "____________________________________________________________________________________________________\n",
      "episode: 139000 loss tensor(0., device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.5766523418823702\n",
      "gzsl: unseen=0.4165 , seen=0.8197 , h=0.5524\n",
      "____________________________________________________________________________________________________\n",
      "episode: 140000 loss tensor(0., device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.5452170854994588\n",
      "gzsl: unseen=0.3745 , seen=0.8115 , h=0.5125\n",
      "____________________________________________________________________________________________________\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "episode: 141000 loss tensor(0., device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.5404455186736566\n",
      "gzsl: unseen=0.3424 , seen=0.8008 , h=0.4797\n",
      "____________________________________________________________________________________________________\n",
      "episode: 142000 loss tensor(0.0121, device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.5611359111116136\n",
      "gzsl: unseen=0.3997 , seen=0.8239 , h=0.5383\n",
      "____________________________________________________________________________________________________\n",
      "episode: 143000 loss tensor(0., device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.5919157606469918\n",
      "gzsl: unseen=0.4187 , seen=0.8126 , h=0.5526\n",
      "____________________________________________________________________________________________________\n",
      "episode: 144000 loss tensor(0., device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.5794965602684591\n",
      "gzsl: unseen=0.4303 , seen=0.8208 , h=0.5647\n",
      "____________________________________________________________________________________________________\n",
      "episode: 145000 loss tensor(0., device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.5498096756232268\n",
      "gzsl: unseen=0.4043 , seen=0.8153 , h=0.5406\n",
      "____________________________________________________________________________________________________\n",
      "episode: 146000 loss tensor(0.0055, device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.5598463063470985\n",
      "gzsl: unseen=0.3460 , seen=0.8192 , h=0.4865\n",
      "____________________________________________________________________________________________________\n",
      "episode: 147000 loss tensor(0., device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.5788850583141026\n",
      "gzsl: unseen=0.4029 , seen=0.8154 , h=0.5393\n",
      "____________________________________________________________________________________________________\n",
      "episode: 148000 loss tensor(0., device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.564310203375165\n",
      "gzsl: unseen=0.4022 , seen=0.8159 , h=0.5388\n",
      "____________________________________________________________________________________________________\n",
      "episode: 149000 loss tensor(0.0089, device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.5706304733133755\n",
      "gzsl: unseen=0.4218 , seen=0.8142 , h=0.5557\n",
      "____________________________________________________________________________________________________\n",
      "episode: 150000 loss tensor(0., device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.603605156721325\n",
      "gzsl: unseen=0.4392 , seen=0.8184 , h=0.5717\n",
      "____________________________________________________________________________________________________\n",
      "episode: 151000 loss tensor(0., device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.6000363953487582\n",
      "gzsl: unseen=0.4231 , seen=0.8084 , h=0.5555\n",
      "____________________________________________________________________________________________________\n",
      "episode: 152000 loss tensor(0., device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.5876690658473633\n",
      "gzsl: unseen=0.4412 , seen=0.8126 , h=0.5719\n",
      "____________________________________________________________________________________________________\n",
      "episode: 153000 loss tensor(0.0056, device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.6029165295918916\n",
      "gzsl: unseen=0.4277 , seen=0.7903 , h=0.5550\n",
      "____________________________________________________________________________________________________\n",
      "episode: 154000 loss tensor(0., device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.608713494131323\n",
      "gzsl: unseen=0.4681 , seen=0.7976 , h=0.5900\n",
      "____________________________________________________________________________________________________\n",
      "episode: 155000 loss tensor(0., device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.5856712680850695\n",
      "gzsl: unseen=0.4423 , seen=0.7989 , h=0.5694\n",
      "____________________________________________________________________________________________________\n",
      "episode: 156000 loss tensor(0., device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.5631922423215651\n",
      "gzsl: unseen=0.4223 , seen=0.8106 , h=0.5553\n",
      "____________________________________________________________________________________________________\n",
      "episode: 157000 loss tensor(0., device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.5772390660730745\n",
      "gzsl: unseen=0.4281 , seen=0.8007 , h=0.5579\n",
      "____________________________________________________________________________________________________\n",
      "episode: 158000 loss tensor(0., device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.576616351210836\n",
      "gzsl: unseen=0.3741 , seen=0.8123 , h=0.5123\n",
      "____________________________________________________________________________________________________\n",
      "episode: 159000 loss tensor(0.0184, device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.5970246522755593\n",
      "gzsl: unseen=0.4186 , seen=0.8139 , h=0.5529\n",
      "____________________________________________________________________________________________________\n",
      "episode: 160000 loss tensor(0.0077, device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.6089181175977099\n",
      "gzsl: unseen=0.4510 , seen=0.8145 , h=0.5805\n",
      "____________________________________________________________________________________________________\n",
      "episode: 161000 loss tensor(0., device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.5938655072608747\n",
      "gzsl: unseen=0.4450 , seen=0.8015 , h=0.5723\n",
      "____________________________________________________________________________________________________\n",
      "episode: 162000 loss tensor(0., device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.5889426166549817\n",
      "gzsl: unseen=0.4387 , seen=0.8073 , h=0.5685\n",
      "____________________________________________________________________________________________________\n",
      "episode: 163000 loss tensor(0., device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.5659320377159912\n",
      "gzsl: unseen=0.4224 , seen=0.8045 , h=0.5539\n",
      "____________________________________________________________________________________________________\n",
      "episode: 164000 loss tensor(0., device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.5907981271989385\n",
      "gzsl: unseen=0.4400 , seen=0.8123 , h=0.5708\n",
      "____________________________________________________________________________________________________\n",
      "episode: 165000 loss tensor(0., device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.5665086927793422\n",
      "gzsl: unseen=0.4349 , seen=0.7910 , h=0.5613\n",
      "____________________________________________________________________________________________________\n",
      "episode: 166000 loss tensor(0., device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.563022358943241\n",
      "gzsl: unseen=0.4254 , seen=0.7975 , h=0.5549\n",
      "____________________________________________________________________________________________________\n",
      "episode: 167000 loss tensor(0., device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.5534008132948328\n",
      "gzsl: unseen=0.4138 , seen=0.7767 , h=0.5400\n",
      "____________________________________________________________________________________________________\n",
      "episode: 168000 loss tensor(0., device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.594420145330601\n",
      "gzsl: unseen=0.4587 , seen=0.7991 , h=0.5829\n",
      "____________________________________________________________________________________________________\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "episode: 169000 loss tensor(0., device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.5841401577878815\n",
      "gzsl: unseen=0.4375 , seen=0.7898 , h=0.5631\n",
      "____________________________________________________________________________________________________\n",
      "episode: 170000 loss tensor(0., device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.5653565027799093\n",
      "gzsl: unseen=0.4784 , seen=0.7791 , h=0.5928\n",
      "____________________________________________________________________________________________________\n",
      "episode: 171000 loss tensor(0., device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.5212303390068184\n",
      "gzsl: unseen=0.4145 , seen=0.7815 , h=0.5417\n",
      "____________________________________________________________________________________________________\n",
      "episode: 172000 loss tensor(0.0280, device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.5695276078975727\n",
      "gzsl: unseen=0.4142 , seen=0.7862 , h=0.5425\n",
      "____________________________________________________________________________________________________\n",
      "episode: 173000 loss tensor(0.0392, device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.5832872260229388\n",
      "gzsl: unseen=0.4519 , seen=0.7920 , h=0.5754\n",
      "____________________________________________________________________________________________________\n",
      "episode: 174000 loss tensor(0., device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.5537939404322618\n",
      "gzsl: unseen=0.4280 , seen=0.7854 , h=0.5540\n",
      "____________________________________________________________________________________________________\n",
      "episode: 175000 loss tensor(0., device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.563879191670884\n",
      "gzsl: unseen=0.4075 , seen=0.7919 , h=0.5381\n",
      "____________________________________________________________________________________________________\n",
      "episode: 176000 loss tensor(0., device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.5857403768516306\n",
      "gzsl: unseen=0.4793 , seen=0.7967 , h=0.5986\n",
      "____________________________________________________________________________________________________\n",
      "episode: 177000 loss tensor(0., device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.5599375164202274\n",
      "gzsl: unseen=0.4349 , seen=0.7954 , h=0.5623\n",
      "____________________________________________________________________________________________________\n",
      "episode: 178000 loss tensor(0., device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.5998406194554844\n",
      "gzsl: unseen=0.4631 , seen=0.8005 , h=0.5867\n",
      "____________________________________________________________________________________________________\n",
      "episode: 179000 loss tensor(0., device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.5993108619651364\n",
      "gzsl: unseen=0.4505 , seen=0.7967 , h=0.5755\n",
      "____________________________________________________________________________________________________\n",
      "episode: 180000 loss tensor(0., device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.5979457157445445\n",
      "gzsl: unseen=0.4485 , seen=0.8024 , h=0.5754\n",
      "____________________________________________________________________________________________________\n",
      "episode: 181000 loss tensor(0., device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.5416214097881633\n",
      "gzsl: unseen=0.4198 , seen=0.7979 , h=0.5502\n",
      "____________________________________________________________________________________________________\n",
      "episode: 182000 loss tensor(0.0357, device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.6016746902665209\n",
      "gzsl: unseen=0.4278 , seen=0.8097 , h=0.5598\n",
      "____________________________________________________________________________________________________\n",
      "episode: 183000 loss tensor(0., device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.5901903762198518\n",
      "gzsl: unseen=0.4369 , seen=0.7938 , h=0.5636\n",
      "____________________________________________________________________________________________________\n",
      "episode: 184000 loss tensor(0., device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.5851432584986019\n",
      "gzsl: unseen=0.4644 , seen=0.7880 , h=0.5844\n",
      "____________________________________________________________________________________________________\n",
      "episode: 185000 loss tensor(0., device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.5854548446133258\n",
      "gzsl: unseen=0.4578 , seen=0.7821 , h=0.5775\n",
      "____________________________________________________________________________________________________\n",
      "episode: 186000 loss tensor(0., device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.568439324490622\n",
      "gzsl: unseen=0.4505 , seen=0.7906 , h=0.5739\n",
      "____________________________________________________________________________________________________\n",
      "episode: 187000 loss tensor(0., device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.6203532429268728\n",
      "gzsl: unseen=0.4837 , seen=0.7997 , h=0.6028\n",
      "____________________________________________________________________________________________________\n",
      "episode: 188000 loss tensor(0.0191, device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.5971372224853534\n",
      "gzsl: unseen=0.4079 , seen=0.7838 , h=0.5366\n",
      "____________________________________________________________________________________________________\n",
      "episode: 189000 loss tensor(0., device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.5708016078657657\n",
      "gzsl: unseen=0.4058 , seen=0.7861 , h=0.5353\n",
      "____________________________________________________________________________________________________\n",
      "episode: 190000 loss tensor(0., device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.5934349121799121\n",
      "gzsl: unseen=0.4486 , seen=0.7935 , h=0.5731\n",
      "____________________________________________________________________________________________________\n",
      "episode: 191000 loss tensor(0., device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.5567633232166319\n",
      "gzsl: unseen=0.4415 , seen=0.7877 , h=0.5659\n",
      "____________________________________________________________________________________________________\n",
      "episode: 192000 loss tensor(0., device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.5465375353803438\n",
      "gzsl: unseen=0.4295 , seen=0.7844 , h=0.5551\n",
      "____________________________________________________________________________________________________\n",
      "episode: 193000 loss tensor(0., device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.5682937907103378\n",
      "gzsl: unseen=0.4419 , seen=0.7903 , h=0.5668\n",
      "____________________________________________________________________________________________________\n",
      "episode: 194000 loss tensor(0., device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.5848991410027105\n",
      "gzsl: unseen=0.4405 , seen=0.7879 , h=0.5650\n",
      "____________________________________________________________________________________________________\n",
      "episode: 195000 loss tensor(0., device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.573173558317122\n",
      "gzsl: unseen=0.4507 , seen=0.7816 , h=0.5718\n",
      "____________________________________________________________________________________________________\n",
      "episode: 196000 loss tensor(0., device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.5948049447482379\n",
      "gzsl: unseen=0.4577 , seen=0.7890 , h=0.5793\n",
      "____________________________________________________________________________________________________\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "episode: 197000 loss tensor(0.0014, device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.5889262172611867\n",
      "gzsl: unseen=0.4606 , seen=0.7821 , h=0.5797\n",
      "____________________________________________________________________________________________________\n",
      "episode: 198000 loss tensor(0., device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.5907680242259881\n",
      "gzsl: unseen=0.4446 , seen=0.7787 , h=0.5660\n",
      "____________________________________________________________________________________________________\n",
      "episode: 199000 loss tensor(0., device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.566189541853254\n",
      "gzsl: unseen=0.4311 , seen=0.7819 , h=0.5558\n",
      "____________________________________________________________________________________________________\n",
      "episode: 200000 loss tensor(0., device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.5840806151480467\n",
      "gzsl: unseen=0.4336 , seen=0.7974 , h=0.5617\n",
      "____________________________________________________________________________________________________\n",
      "episode: 201000 loss tensor(0., device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.5918769237333296\n",
      "gzsl: unseen=0.4600 , seen=0.7964 , h=0.5832\n",
      "____________________________________________________________________________________________________\n",
      "episode: 202000 loss tensor(0., device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.5898406105340323\n",
      "gzsl: unseen=0.4507 , seen=0.8046 , h=0.5778\n",
      "____________________________________________________________________________________________________\n",
      "episode: 203000 loss tensor(0., device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.6019758632837361\n",
      "gzsl: unseen=0.4725 , seen=0.8032 , h=0.5950\n",
      "____________________________________________________________________________________________________\n",
      "episode: 204000 loss tensor(0., device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.5997316718174963\n",
      "gzsl: unseen=0.4558 , seen=0.8051 , h=0.5821\n",
      "____________________________________________________________________________________________________\n",
      "episode: 205000 loss tensor(0., device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.609476401868756\n",
      "gzsl: unseen=0.4897 , seen=0.7920 , h=0.6052\n",
      "____________________________________________________________________________________________________\n",
      "episode: 206000 loss tensor(0., device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.5833072381318832\n",
      "gzsl: unseen=0.4688 , seen=0.7826 , h=0.5864\n",
      "____________________________________________________________________________________________________\n",
      "episode: 207000 loss tensor(0., device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.5968380397278935\n",
      "gzsl: unseen=0.4648 , seen=0.8019 , h=0.5885\n",
      "____________________________________________________________________________________________________\n",
      "episode: 208000 loss tensor(0., device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.5971448536511146\n",
      "gzsl: unseen=0.4767 , seen=0.7962 , h=0.5964\n",
      "____________________________________________________________________________________________________\n",
      "episode: 209000 loss tensor(0., device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.6151914099119321\n",
      "gzsl: unseen=0.4870 , seen=0.7960 , h=0.6043\n",
      "____________________________________________________________________________________________________\n",
      "episode: 210000 loss tensor(0., device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.5984668418444461\n",
      "gzsl: unseen=0.4931 , seen=0.7952 , h=0.6087\n",
      "____________________________________________________________________________________________________\n",
      "episode: 211000 loss tensor(0., device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.5909947631670053\n",
      "gzsl: unseen=0.4833 , seen=0.7863 , h=0.5987\n",
      "____________________________________________________________________________________________________\n",
      "episode: 212000 loss tensor(0., device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.5848671439950709\n",
      "gzsl: unseen=0.4765 , seen=0.7802 , h=0.5917\n",
      "____________________________________________________________________________________________________\n",
      "episode: 213000 loss tensor(0., device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.599062205345687\n",
      "gzsl: unseen=0.5009 , seen=0.7891 , h=0.6128\n",
      "____________________________________________________________________________________________________\n",
      "episode: 214000 loss tensor(0., device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.5870900706041727\n",
      "gzsl: unseen=0.4805 , seen=0.8000 , h=0.6004\n",
      "____________________________________________________________________________________________________\n",
      "episode: 215000 loss tensor(0., device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.5778264350296087\n",
      "gzsl: unseen=0.4663 , seen=0.7808 , h=0.5839\n",
      "____________________________________________________________________________________________________\n",
      "episode: 216000 loss tensor(0.0101, device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.5788267720768657\n",
      "gzsl: unseen=0.4594 , seen=0.7867 , h=0.5801\n",
      "____________________________________________________________________________________________________\n",
      "episode: 217000 loss tensor(0., device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.563285450869872\n",
      "gzsl: unseen=0.4748 , seen=0.7787 , h=0.5899\n",
      "____________________________________________________________________________________________________\n",
      "episode: 218000 loss tensor(0., device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.5774008971472688\n",
      "gzsl: unseen=0.4803 , seen=0.7807 , h=0.5947\n",
      "____________________________________________________________________________________________________\n",
      "episode: 219000 loss tensor(0.0193, device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.5754225889260971\n",
      "gzsl: unseen=0.4700 , seen=0.7828 , h=0.5874\n",
      "____________________________________________________________________________________________________\n",
      "episode: 220000 loss tensor(0., device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.5453092396644607\n",
      "gzsl: unseen=0.4577 , seen=0.7670 , h=0.5733\n",
      "____________________________________________________________________________________________________\n",
      "episode: 221000 loss tensor(0., device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.5773571245362044\n",
      "gzsl: unseen=0.4786 , seen=0.7744 , h=0.5916\n",
      "____________________________________________________________________________________________________\n",
      "episode: 222000 loss tensor(0., device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.5873556462426045\n",
      "gzsl: unseen=0.4860 , seen=0.7798 , h=0.5988\n",
      "____________________________________________________________________________________________________\n",
      "episode: 223000 loss tensor(0., device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.5290556350862872\n",
      "gzsl: unseen=0.4401 , seen=0.7749 , h=0.5614\n",
      "____________________________________________________________________________________________________\n",
      "episode: 224000 loss tensor(0., device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.5778668638677504\n",
      "gzsl: unseen=0.4747 , seen=0.7720 , h=0.5879\n",
      "____________________________________________________________________________________________________\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "episode: 225000 loss tensor(0., device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.5794587651157685\n",
      "gzsl: unseen=0.4945 , seen=0.7666 , h=0.6012\n",
      "____________________________________________________________________________________________________\n",
      "episode: 226000 loss tensor(0., device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.5647406647263861\n",
      "gzsl: unseen=0.4730 , seen=0.7707 , h=0.5862\n",
      "____________________________________________________________________________________________________\n",
      "episode: 227000 loss tensor(0., device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.5717397449487029\n",
      "gzsl: unseen=0.4722 , seen=0.7821 , h=0.5889\n",
      "____________________________________________________________________________________________________\n",
      "episode: 228000 loss tensor(0., device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.5911419089774119\n",
      "gzsl: unseen=0.4863 , seen=0.7731 , h=0.5970\n",
      "____________________________________________________________________________________________________\n",
      "episode: 229000 loss tensor(0., device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.5941426607109269\n",
      "gzsl: unseen=0.4861 , seen=0.7758 , h=0.5977\n",
      "____________________________________________________________________________________________________\n",
      "episode: 230000 loss tensor(0., device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.588336389842351\n",
      "gzsl: unseen=0.4837 , seen=0.7712 , h=0.5945\n",
      "____________________________________________________________________________________________________\n",
      "episode: 231000 loss tensor(0., device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.5954995470499587\n",
      "gzsl: unseen=0.5002 , seen=0.7827 , h=0.6104\n",
      "____________________________________________________________________________________________________\n",
      "episode: 232000 loss tensor(0., device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.6001270665008943\n",
      "gzsl: unseen=0.5013 , seen=0.7781 , h=0.6097\n",
      "____________________________________________________________________________________________________\n",
      "episode: 233000 loss tensor(0., device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.5969368054208208\n",
      "gzsl: unseen=0.4870 , seen=0.7659 , h=0.5954\n",
      "____________________________________________________________________________________________________\n",
      "episode: 234000 loss tensor(0., device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.5723864246560849\n",
      "gzsl: unseen=0.4632 , seen=0.7735 , h=0.5794\n",
      "____________________________________________________________________________________________________\n",
      "episode: 235000 loss tensor(0., device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.5659247090186778\n",
      "gzsl: unseen=0.4646 , seen=0.7767 , h=0.5814\n",
      "____________________________________________________________________________________________________\n",
      "episode: 236000 loss tensor(0., device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.5921602187664023\n",
      "gzsl: unseen=0.4652 , seen=0.7873 , h=0.5848\n",
      "____________________________________________________________________________________________________\n",
      "episode: 237000 loss tensor(0., device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.5639464413233373\n",
      "gzsl: unseen=0.4571 , seen=0.7586 , h=0.5704\n",
      "____________________________________________________________________________________________________\n",
      "episode: 238000 loss tensor(0., device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.5827209330420027\n",
      "gzsl: unseen=0.4657 , seen=0.7831 , h=0.5840\n",
      "____________________________________________________________________________________________________\n",
      "episode: 239000 loss tensor(0., device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.5964920056561784\n",
      "gzsl: unseen=0.4884 , seen=0.7809 , h=0.6010\n",
      "____________________________________________________________________________________________________\n",
      "episode: 240000 loss tensor(0., device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.5912610420862705\n",
      "gzsl: unseen=0.4730 , seen=0.7837 , h=0.5899\n",
      "____________________________________________________________________________________________________\n",
      "episode: 241000 loss tensor(0., device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.5918114887182907\n",
      "gzsl: unseen=0.4539 , seen=0.7712 , h=0.5715\n",
      "____________________________________________________________________________________________________\n",
      "episode: 242000 loss tensor(0., device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.598985133798453\n",
      "gzsl: unseen=0.4585 , seen=0.7731 , h=0.5756\n",
      "____________________________________________________________________________________________________\n",
      "episode: 243000 loss tensor(0., device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.5998766075178658\n",
      "gzsl: unseen=0.4311 , seen=0.7960 , h=0.5593\n",
      "____________________________________________________________________________________________________\n",
      "episode: 244000 loss tensor(0., device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.6073282149985112\n",
      "gzsl: unseen=0.4651 , seen=0.7915 , h=0.5859\n",
      "____________________________________________________________________________________________________\n",
      "episode: 245000 loss tensor(0., device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.6011662900320356\n",
      "gzsl: unseen=0.4563 , seen=0.7879 , h=0.5780\n",
      "____________________________________________________________________________________________________\n",
      "episode: 246000 loss tensor(0., device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.5835687051192273\n",
      "gzsl: unseen=0.4756 , seen=0.7806 , h=0.5911\n",
      "____________________________________________________________________________________________________\n",
      "episode: 247000 loss tensor(0., device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.5907874153701208\n",
      "gzsl: unseen=0.4847 , seen=0.7736 , h=0.5960\n",
      "____________________________________________________________________________________________________\n",
      "episode: 248000 loss tensor(0., device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.5683802057571853\n",
      "gzsl: unseen=0.4724 , seen=0.7611 , h=0.5830\n",
      "____________________________________________________________________________________________________\n",
      "episode: 249000 loss tensor(0., device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.587588127954154\n",
      "gzsl: unseen=0.4825 , seen=0.7623 , h=0.5910\n",
      "____________________________________________________________________________________________________\n",
      "episode: 250000 loss tensor(0., device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.5663057199501219\n",
      "gzsl: unseen=0.4859 , seen=0.7651 , h=0.5944\n",
      "____________________________________________________________________________________________________\n",
      "episode: 251000 loss tensor(0., device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.6000119878524452\n",
      "gzsl: unseen=0.4872 , seen=0.7674 , h=0.5960\n",
      "____________________________________________________________________________________________________\n",
      "episode: 252000 loss tensor(0., device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.5973557936557605\n",
      "gzsl: unseen=0.4935 , seen=0.7733 , h=0.6025\n",
      "____________________________________________________________________________________________________\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "episode: 253000 loss tensor(0., device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.5509675163414672\n",
      "gzsl: unseen=0.4529 , seen=0.7582 , h=0.5671\n",
      "____________________________________________________________________________________________________\n",
      "episode: 254000 loss tensor(0., device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.586464010888718\n",
      "gzsl: unseen=0.4960 , seen=0.7738 , h=0.6045\n",
      "____________________________________________________________________________________________________\n",
      "episode: 255000 loss tensor(0., device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.5822212389531278\n",
      "gzsl: unseen=0.4851 , seen=0.7701 , h=0.5952\n",
      "____________________________________________________________________________________________________\n",
      "episode: 256000 loss tensor(0., device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.5893210056727953\n",
      "gzsl: unseen=0.4901 , seen=0.7707 , h=0.5992\n",
      "____________________________________________________________________________________________________\n",
      "episode: 257000 loss tensor(0., device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.5981619934430964\n",
      "gzsl: unseen=0.4840 , seen=0.7879 , h=0.5996\n",
      "____________________________________________________________________________________________________\n",
      "episode: 258000 loss tensor(0., device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.5887098050020603\n",
      "gzsl: unseen=0.4818 , seen=0.7741 , h=0.5939\n",
      "____________________________________________________________________________________________________\n",
      "episode: 259000 loss tensor(0., device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.5626568991541557\n",
      "gzsl: unseen=0.4675 , seen=0.7781 , h=0.5841\n",
      "____________________________________________________________________________________________________\n",
      "episode: 260000 loss tensor(0., device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.5799336668946767\n",
      "gzsl: unseen=0.4878 , seen=0.7737 , h=0.5983\n",
      "____________________________________________________________________________________________________\n",
      "episode: 261000 loss tensor(0., device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.5679080991133776\n",
      "gzsl: unseen=0.4494 , seen=0.7711 , h=0.5679\n",
      "____________________________________________________________________________________________________\n",
      "episode: 262000 loss tensor(0., device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.5900902662377617\n",
      "gzsl: unseen=0.4881 , seen=0.7645 , h=0.5958\n",
      "____________________________________________________________________________________________________\n",
      "episode: 263000 loss tensor(0., device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.5844797504492639\n",
      "gzsl: unseen=0.4763 , seen=0.7576 , h=0.5849\n",
      "____________________________________________________________________________________________________\n",
      "episode: 264000 loss tensor(0., device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.5963291449541568\n",
      "gzsl: unseen=0.4860 , seen=0.7557 , h=0.5915\n",
      "____________________________________________________________________________________________________\n",
      "episode: 265000 loss tensor(0., device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.5931461060236264\n",
      "gzsl: unseen=0.5058 , seen=0.7681 , h=0.6100\n",
      "____________________________________________________________________________________________________\n",
      "episode: 266000 loss tensor(0., device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.5631267319592059\n",
      "gzsl: unseen=0.4436 , seen=0.7698 , h=0.5629\n",
      "____________________________________________________________________________________________________\n",
      "episode: 267000 loss tensor(0., device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.5957214103231556\n",
      "gzsl: unseen=0.5083 , seen=0.7807 , h=0.6157\n",
      "____________________________________________________________________________________________________\n",
      "episode: 268000 loss tensor(0., device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.5955510003470369\n",
      "gzsl: unseen=0.4903 , seen=0.7724 , h=0.5998\n",
      "____________________________________________________________________________________________________\n",
      "episode: 269000 loss tensor(0., device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.5865483868065892\n",
      "gzsl: unseen=0.4755 , seen=0.7741 , h=0.5891\n",
      "____________________________________________________________________________________________________\n",
      "episode: 270000 loss tensor(0., device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.5854918470752033\n",
      "gzsl: unseen=0.4744 , seen=0.7721 , h=0.5877\n",
      "____________________________________________________________________________________________________\n",
      "episode: 271000 loss tensor(0., device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.5907890844067969\n",
      "gzsl: unseen=0.4852 , seen=0.7677 , h=0.5946\n",
      "____________________________________________________________________________________________________\n",
      "episode: 272000 loss tensor(0., device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.5736755862527728\n",
      "gzsl: unseen=0.4790 , seen=0.7637 , h=0.5887\n",
      "____________________________________________________________________________________________________\n",
      "episode: 273000 loss tensor(0., device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.5866610717287702\n",
      "gzsl: unseen=0.4675 , seen=0.7785 , h=0.5842\n",
      "____________________________________________________________________________________________________\n",
      "episode: 274000 loss tensor(0., device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.5907104380449074\n",
      "gzsl: unseen=0.4954 , seen=0.7664 , h=0.6018\n",
      "____________________________________________________________________________________________________\n",
      "episode: 275000 loss tensor(0., device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.574309020722287\n",
      "gzsl: unseen=0.4944 , seen=0.7696 , h=0.6021\n",
      "____________________________________________________________________________________________________\n",
      "episode: 276000 loss tensor(0., device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.5726084058146457\n",
      "gzsl: unseen=0.4628 , seen=0.7647 , h=0.5766\n",
      "____________________________________________________________________________________________________\n",
      "episode: 277000 loss tensor(0., device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.5650254064134235\n",
      "gzsl: unseen=0.4644 , seen=0.7615 , h=0.5770\n",
      "____________________________________________________________________________________________________\n",
      "episode: 278000 loss tensor(0.0152, device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.5708424132104045\n",
      "gzsl: unseen=0.4560 , seen=0.7863 , h=0.5772\n",
      "____________________________________________________________________________________________________\n",
      "episode: 279000 loss tensor(0., device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.542077561335031\n",
      "gzsl: unseen=0.4331 , seen=0.7726 , h=0.5551\n",
      "____________________________________________________________________________________________________\n",
      "episode: 280000 loss tensor(0., device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.5602562217327298\n",
      "gzsl: unseen=0.4419 , seen=0.7660 , h=0.5605\n",
      "____________________________________________________________________________________________________\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "episode: 281000 loss tensor(0., device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.5776201740678333\n",
      "gzsl: unseen=0.4302 , seen=0.7813 , h=0.5549\n",
      "____________________________________________________________________________________________________\n",
      "episode: 282000 loss tensor(0., device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.572819029718129\n",
      "gzsl: unseen=0.4528 , seen=0.7723 , h=0.5709\n",
      "____________________________________________________________________________________________________\n",
      "episode: 283000 loss tensor(0., device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.5423583982284707\n",
      "gzsl: unseen=0.4128 , seen=0.7644 , h=0.5361\n",
      "____________________________________________________________________________________________________\n",
      "episode: 284000 loss tensor(0., device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.5803164202939615\n",
      "gzsl: unseen=0.4649 , seen=0.7602 , h=0.5770\n",
      "____________________________________________________________________________________________________\n",
      "episode: 285000 loss tensor(0., device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.5830077989757358\n",
      "gzsl: unseen=0.4554 , seen=0.7468 , h=0.5658\n",
      "____________________________________________________________________________________________________\n",
      "episode: 286000 loss tensor(0., device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.5704016373850692\n",
      "gzsl: unseen=0.4440 , seen=0.7535 , h=0.5587\n",
      "____________________________________________________________________________________________________\n",
      "episode: 287000 loss tensor(0., device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.5740694987009128\n",
      "gzsl: unseen=0.4562 , seen=0.7610 , h=0.5704\n",
      "____________________________________________________________________________________________________\n",
      "episode: 288000 loss tensor(0., device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.5634177257891081\n",
      "gzsl: unseen=0.4559 , seen=0.7566 , h=0.5690\n",
      "____________________________________________________________________________________________________\n",
      "episode: 289000 loss tensor(0., device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.5910384250608332\n",
      "gzsl: unseen=0.4809 , seen=0.7739 , h=0.5932\n",
      "____________________________________________________________________________________________________\n",
      "episode: 290000 loss tensor(0., device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.5824869670310646\n",
      "gzsl: unseen=0.4666 , seen=0.7612 , h=0.5786\n",
      "____________________________________________________________________________________________________\n",
      "episode: 291000 loss tensor(0., device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.6019526296557945\n",
      "gzsl: unseen=0.4916 , seen=0.7792 , h=0.6029\n",
      "____________________________________________________________________________________________________\n",
      "episode: 292000 loss tensor(0., device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.6150282520360103\n",
      "gzsl: unseen=0.4979 , seen=0.7713 , h=0.6052\n",
      "____________________________________________________________________________________________________\n",
      "episode: 293000 loss tensor(0., device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.6092957295541209\n",
      "gzsl: unseen=0.5084 , seen=0.7734 , h=0.6135\n",
      "____________________________________________________________________________________________________\n",
      "episode: 294000 loss tensor(0., device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.5964304197101425\n",
      "gzsl: unseen=0.4808 , seen=0.7675 , h=0.5912\n",
      "____________________________________________________________________________________________________\n",
      "episode: 295000 loss tensor(0.0083, device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.6018466427966682\n",
      "gzsl: unseen=0.4860 , seen=0.7690 , h=0.5956\n",
      "____________________________________________________________________________________________________\n",
      "episode: 296000 loss tensor(0., device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.5991412790387984\n",
      "gzsl: unseen=0.5220 , seen=0.7626 , h=0.6198\n",
      "____________________________________________________________________________________________________\n",
      "episode: 297000 loss tensor(0., device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.5985716334676789\n",
      "gzsl: unseen=0.5049 , seen=0.7669 , h=0.6089\n",
      "____________________________________________________________________________________________________\n",
      "episode: 298000 loss tensor(0., device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.6127351024260983\n",
      "gzsl: unseen=0.5097 , seen=0.7514 , h=0.6074\n",
      "____________________________________________________________________________________________________\n",
      "episode: 299000 loss tensor(0., device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.5948897640128916\n",
      "gzsl: unseen=0.4725 , seen=0.7544 , h=0.5810\n",
      "____________________________________________________________________________________________________\n",
      "episode: 300000 loss tensor(0., device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.6068400201690711\n",
      "gzsl: unseen=0.4666 , seen=0.7729 , h=0.5819\n",
      "____________________________________________________________________________________________________\n",
      "episode: 301000 loss tensor(0., device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.5991153416521274\n",
      "gzsl: unseen=0.4703 , seen=0.7572 , h=0.5802\n",
      "____________________________________________________________________________________________________\n",
      "episode: 302000 loss tensor(0., device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.6119218533570783\n",
      "gzsl: unseen=0.4896 , seen=0.7671 , h=0.5977\n",
      "____________________________________________________________________________________________________\n",
      "episode: 303000 loss tensor(0., device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.5939940083157532\n",
      "gzsl: unseen=0.4893 , seen=0.7515 , h=0.5927\n",
      "____________________________________________________________________________________________________\n",
      "episode: 304000 loss tensor(0., device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.6018596298577376\n",
      "gzsl: unseen=0.4969 , seen=0.7652 , h=0.6025\n",
      "____________________________________________________________________________________________________\n",
      "episode: 305000 loss tensor(0., device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.5951804188061309\n",
      "gzsl: unseen=0.4736 , seen=0.7715 , h=0.5869\n",
      "____________________________________________________________________________________________________\n",
      "episode: 306000 loss tensor(0., device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.6003307235115096\n",
      "gzsl: unseen=0.4871 , seen=0.7672 , h=0.5959\n",
      "____________________________________________________________________________________________________\n",
      "episode: 307000 loss tensor(0., device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.607933359446031\n",
      "gzsl: unseen=0.5015 , seen=0.7588 , h=0.6039\n",
      "____________________________________________________________________________________________________\n",
      "episode: 308000 loss tensor(0., device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.6056290137712376\n",
      "gzsl: unseen=0.4761 , seen=0.7598 , h=0.5854\n",
      "____________________________________________________________________________________________________\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "episode: 309000 loss tensor(0., device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.6104873740637944\n",
      "gzsl: unseen=0.4941 , seen=0.7695 , h=0.6018\n",
      "____________________________________________________________________________________________________\n",
      "episode: 310000 loss tensor(0.0422, device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.6148046173125106\n",
      "gzsl: unseen=0.4950 , seen=0.7764 , h=0.6045\n",
      "____________________________________________________________________________________________________\n",
      "episode: 311000 loss tensor(0., device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.5908759811491905\n",
      "gzsl: unseen=0.4850 , seen=0.7701 , h=0.5951\n",
      "____________________________________________________________________________________________________\n",
      "episode: 312000 loss tensor(0., device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.5932156966749115\n",
      "gzsl: unseen=0.4814 , seen=0.7643 , h=0.5908\n",
      "____________________________________________________________________________________________________\n",
      "episode: 313000 loss tensor(0., device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.598039039823799\n",
      "gzsl: unseen=0.4765 , seen=0.7716 , h=0.5891\n",
      "____________________________________________________________________________________________________\n",
      "episode: 314000 loss tensor(0., device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.6030942281011509\n",
      "gzsl: unseen=0.4636 , seen=0.7660 , h=0.5776\n",
      "____________________________________________________________________________________________________\n",
      "episode: 315000 loss tensor(0., device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.6290140402938782\n",
      "gzsl: unseen=0.4752 , seen=0.7625 , h=0.5855\n",
      "____________________________________________________________________________________________________\n",
      "episode: 316000 loss tensor(0., device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.6162603960923223\n",
      "gzsl: unseen=0.4673 , seen=0.7761 , h=0.5834\n",
      "____________________________________________________________________________________________________\n",
      "episode: 317000 loss tensor(0., device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.6128530711566574\n",
      "gzsl: unseen=0.4738 , seen=0.7844 , h=0.5908\n",
      "____________________________________________________________________________________________________\n",
      "episode: 318000 loss tensor(0., device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.619817691204752\n",
      "gzsl: unseen=0.4782 , seen=0.7732 , h=0.5909\n",
      "____________________________________________________________________________________________________\n",
      "episode: 319000 loss tensor(0., device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.6116057652671258\n",
      "gzsl: unseen=0.4835 , seen=0.7822 , h=0.5976\n",
      "____________________________________________________________________________________________________\n",
      "episode: 320000 loss tensor(0., device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.6052036569844255\n",
      "gzsl: unseen=0.4757 , seen=0.7801 , h=0.5910\n",
      "____________________________________________________________________________________________________\n",
      "episode: 321000 loss tensor(0., device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.6088550180618113\n",
      "gzsl: unseen=0.4678 , seen=0.7878 , h=0.5870\n",
      "____________________________________________________________________________________________________\n",
      "episode: 322000 loss tensor(0., device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.6243428951922319\n",
      "gzsl: unseen=0.4882 , seen=0.7825 , h=0.6013\n",
      "____________________________________________________________________________________________________\n",
      "episode: 323000 loss tensor(0., device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.6206482554769894\n",
      "gzsl: unseen=0.4813 , seen=0.7840 , h=0.5964\n",
      "____________________________________________________________________________________________________\n",
      "episode: 324000 loss tensor(0., device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.6096452639266773\n",
      "gzsl: unseen=0.4793 , seen=0.7771 , h=0.5929\n",
      "____________________________________________________________________________________________________\n",
      "episode: 325000 loss tensor(0., device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.6002606529844258\n",
      "gzsl: unseen=0.4512 , seen=0.7770 , h=0.5709\n",
      "____________________________________________________________________________________________________\n",
      "episode: 326000 loss tensor(0., device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.6078126791537822\n",
      "gzsl: unseen=0.4744 , seen=0.7928 , h=0.5936\n",
      "____________________________________________________________________________________________________\n",
      "episode: 327000 loss tensor(0., device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.5867029863178266\n",
      "gzsl: unseen=0.4570 , seen=0.7807 , h=0.5765\n",
      "____________________________________________________________________________________________________\n",
      "episode: 328000 loss tensor(0., device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.5888181652903293\n",
      "gzsl: unseen=0.4590 , seen=0.7854 , h=0.5794\n",
      "____________________________________________________________________________________________________\n",
      "episode: 329000 loss tensor(0., device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.6020980915210914\n",
      "gzsl: unseen=0.4772 , seen=0.7798 , h=0.5921\n",
      "____________________________________________________________________________________________________\n",
      "episode: 330000 loss tensor(0., device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.5775316257000264\n",
      "gzsl: unseen=0.4459 , seen=0.7651 , h=0.5634\n",
      "____________________________________________________________________________________________________\n",
      "episode: 331000 loss tensor(0., device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.6053210974605285\n",
      "gzsl: unseen=0.5041 , seen=0.7710 , h=0.6096\n",
      "____________________________________________________________________________________________________\n",
      "episode: 332000 loss tensor(0., device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.6111193476878539\n",
      "gzsl: unseen=0.4997 , seen=0.7665 , h=0.6050\n",
      "____________________________________________________________________________________________________\n",
      "episode: 333000 loss tensor(0., device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.5817209875783749\n",
      "gzsl: unseen=0.4832 , seen=0.7713 , h=0.5942\n",
      "____________________________________________________________________________________________________\n",
      "episode: 334000 loss tensor(0., device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.6067396888924452\n",
      "gzsl: unseen=0.4940 , seen=0.7820 , h=0.6055\n",
      "____________________________________________________________________________________________________\n",
      "episode: 335000 loss tensor(0., device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.5951540809208148\n",
      "gzsl: unseen=0.4852 , seen=0.7771 , h=0.5974\n",
      "____________________________________________________________________________________________________\n",
      "episode: 336000 loss tensor(0., device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.6154752070037701\n",
      "gzsl: unseen=0.5245 , seen=0.7700 , h=0.6240\n",
      "____________________________________________________________________________________________________\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "episode: 337000 loss tensor(0., device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.6041640919673918\n",
      "gzsl: unseen=0.4942 , seen=0.7654 , h=0.6006\n",
      "____________________________________________________________________________________________________\n",
      "episode: 338000 loss tensor(0., device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.5775370415892717\n",
      "gzsl: unseen=0.4787 , seen=0.7715 , h=0.5908\n",
      "____________________________________________________________________________________________________\n",
      "episode: 339000 loss tensor(0., device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.5833054467095214\n",
      "gzsl: unseen=0.4630 , seen=0.7723 , h=0.5790\n",
      "____________________________________________________________________________________________________\n",
      "episode: 340000 loss tensor(0., device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.5905830041807923\n",
      "gzsl: unseen=0.4721 , seen=0.7614 , h=0.5828\n",
      "____________________________________________________________________________________________________\n",
      "episode: 341000 loss tensor(0., device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.6038901891219485\n",
      "gzsl: unseen=0.5036 , seen=0.7568 , h=0.6047\n",
      "____________________________________________________________________________________________________\n",
      "episode: 342000 loss tensor(0., device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.6118226860391036\n",
      "gzsl: unseen=0.4864 , seen=0.7621 , h=0.5938\n",
      "____________________________________________________________________________________________________\n",
      "episode: 343000 loss tensor(0., device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.5973757658388044\n",
      "gzsl: unseen=0.4905 , seen=0.7682 , h=0.5987\n",
      "____________________________________________________________________________________________________\n",
      "episode: 344000 loss tensor(0., device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.5876136687239243\n",
      "gzsl: unseen=0.4761 , seen=0.7663 , h=0.5873\n",
      "____________________________________________________________________________________________________\n",
      "episode: 345000 loss tensor(0., device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.5927258549520925\n",
      "gzsl: unseen=0.4812 , seen=0.7540 , h=0.5875\n",
      "____________________________________________________________________________________________________\n",
      "episode: 346000 loss tensor(0., device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.5926601302216836\n",
      "gzsl: unseen=0.4991 , seen=0.7609 , h=0.6028\n",
      "____________________________________________________________________________________________________\n",
      "episode: 347000 loss tensor(0., device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.6129448503798018\n",
      "gzsl: unseen=0.5010 , seen=0.7690 , h=0.6067\n",
      "____________________________________________________________________________________________________\n",
      "episode: 348000 loss tensor(0., device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.6197207086652187\n",
      "gzsl: unseen=0.5266 , seen=0.7624 , h=0.6229\n",
      "____________________________________________________________________________________________________\n",
      "episode: 349000 loss tensor(0., device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.615390931839557\n",
      "gzsl: unseen=0.5257 , seen=0.7493 , h=0.6179\n",
      "____________________________________________________________________________________________________\n",
      "episode: 350000 loss tensor(0., device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.5998765972668172\n",
      "gzsl: unseen=0.5205 , seen=0.7611 , h=0.6182\n",
      "____________________________________________________________________________________________________\n",
      "episode: 351000 loss tensor(0., device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.6018391602342064\n",
      "gzsl: unseen=0.5184 , seen=0.7501 , h=0.6131\n",
      "____________________________________________________________________________________________________\n",
      "episode: 352000 loss tensor(0., device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.6014761793122039\n",
      "gzsl: unseen=0.4950 , seen=0.7488 , h=0.5960\n",
      "____________________________________________________________________________________________________\n",
      "episode: 353000 loss tensor(0., device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.6103584678535908\n",
      "gzsl: unseen=0.5155 , seen=0.7566 , h=0.6132\n",
      "____________________________________________________________________________________________________\n",
      "episode: 354000 loss tensor(0., device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.5913018543284878\n",
      "gzsl: unseen=0.4989 , seen=0.7530 , h=0.6001\n",
      "____________________________________________________________________________________________________\n",
      "episode: 355000 loss tensor(0., device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.6107551983806585\n",
      "gzsl: unseen=0.5222 , seen=0.7578 , h=0.6183\n",
      "____________________________________________________________________________________________________\n",
      "episode: 356000 loss tensor(0., device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.5976056506353266\n",
      "gzsl: unseen=0.5010 , seen=0.7640 , h=0.6052\n",
      "____________________________________________________________________________________________________\n",
      "episode: 357000 loss tensor(0., device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.5854386802376041\n",
      "gzsl: unseen=0.5075 , seen=0.7552 , h=0.6070\n",
      "____________________________________________________________________________________________________\n",
      "episode: 358000 loss tensor(0., device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.6141674569877026\n",
      "gzsl: unseen=0.5122 , seen=0.7573 , h=0.6111\n",
      "____________________________________________________________________________________________________\n",
      "episode: 359000 loss tensor(0., device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.6059558705908251\n",
      "gzsl: unseen=0.5096 , seen=0.7546 , h=0.6084\n",
      "____________________________________________________________________________________________________\n",
      "episode: 360000 loss tensor(0., device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.6179926694954792\n",
      "gzsl: unseen=0.5260 , seen=0.7587 , h=0.6213\n",
      "____________________________________________________________________________________________________\n",
      "episode: 361000 loss tensor(0., device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.6144654562918034\n",
      "gzsl: unseen=0.5222 , seen=0.7642 , h=0.6204\n",
      "____________________________________________________________________________________________________\n",
      "episode: 362000 loss tensor(0., device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.6184942445977071\n",
      "gzsl: unseen=0.5234 , seen=0.7571 , h=0.6189\n",
      "____________________________________________________________________________________________________\n",
      "episode: 363000 loss tensor(0., device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.6089405460506437\n",
      "gzsl: unseen=0.5088 , seen=0.7454 , h=0.6048\n",
      "____________________________________________________________________________________________________\n",
      "episode: 364000 loss tensor(0., device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.6227610601480702\n",
      "gzsl: unseen=0.5291 , seen=0.7485 , h=0.6199\n",
      "____________________________________________________________________________________________________\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "episode: 365000 loss tensor(0., device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.6037949041212433\n",
      "gzsl: unseen=0.5139 , seen=0.7377 , h=0.6058\n",
      "____________________________________________________________________________________________________\n",
      "episode: 366000 loss tensor(0., device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.6226205299815809\n",
      "gzsl: unseen=0.5300 , seen=0.7479 , h=0.6203\n",
      "____________________________________________________________________________________________________\n",
      "episode: 367000 loss tensor(0., device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.598400136417951\n",
      "gzsl: unseen=0.5171 , seen=0.7521 , h=0.6128\n",
      "____________________________________________________________________________________________________\n",
      "episode: 368000 loss tensor(0.0020, device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.6011277104236149\n",
      "gzsl: unseen=0.4930 , seen=0.7418 , h=0.5923\n",
      "____________________________________________________________________________________________________\n",
      "episode: 369000 loss tensor(0., device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.6038889885148631\n",
      "gzsl: unseen=0.5187 , seen=0.7557 , h=0.6152\n",
      "____________________________________________________________________________________________________\n",
      "episode: 370000 loss tensor(0., device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.5951156651966272\n",
      "gzsl: unseen=0.5087 , seen=0.7639 , h=0.6107\n",
      "____________________________________________________________________________________________________\n",
      "episode: 371000 loss tensor(0., device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.5875610274867021\n",
      "gzsl: unseen=0.4648 , seen=0.7556 , h=0.5756\n",
      "____________________________________________________________________________________________________\n",
      "episode: 372000 loss tensor(0., device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.5855920513349868\n",
      "gzsl: unseen=0.4739 , seen=0.7472 , h=0.5799\n",
      "____________________________________________________________________________________________________\n",
      "episode: 373000 loss tensor(0., device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.5950064333332327\n",
      "gzsl: unseen=0.4870 , seen=0.7470 , h=0.5896\n",
      "____________________________________________________________________________________________________\n",
      "episode: 374000 loss tensor(0., device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.5978437569402434\n",
      "gzsl: unseen=0.4829 , seen=0.7573 , h=0.5897\n",
      "____________________________________________________________________________________________________\n",
      "episode: 375000 loss tensor(0., device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.5723748249566197\n",
      "gzsl: unseen=0.4620 , seen=0.7489 , h=0.5714\n",
      "____________________________________________________________________________________________________\n",
      "episode: 376000 loss tensor(0., device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.6070715933240144\n",
      "gzsl: unseen=0.4998 , seen=0.7519 , h=0.6004\n",
      "____________________________________________________________________________________________________\n",
      "episode: 377000 loss tensor(0., device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.6005409377948026\n",
      "gzsl: unseen=0.4875 , seen=0.7468 , h=0.5899\n",
      "____________________________________________________________________________________________________\n",
      "episode: 378000 loss tensor(0., device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.6000126553126638\n",
      "gzsl: unseen=0.5161 , seen=0.7498 , h=0.6114\n",
      "____________________________________________________________________________________________________\n",
      "episode: 379000 loss tensor(0., device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.6014015089066121\n",
      "gzsl: unseen=0.5197 , seen=0.7535 , h=0.6151\n",
      "____________________________________________________________________________________________________\n",
      "episode: 380000 loss tensor(0., device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.5937333225436672\n",
      "gzsl: unseen=0.5124 , seen=0.7516 , h=0.6094\n",
      "____________________________________________________________________________________________________\n",
      "episode: 381000 loss tensor(0., device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.5884922589265961\n",
      "gzsl: unseen=0.5022 , seen=0.7566 , h=0.6037\n",
      "____________________________________________________________________________________________________\n",
      "episode: 382000 loss tensor(0., device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.5930507813957362\n",
      "gzsl: unseen=0.5041 , seen=0.7598 , h=0.6060\n",
      "____________________________________________________________________________________________________\n",
      "episode: 383000 loss tensor(0., device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.5920171736594846\n",
      "gzsl: unseen=0.4911 , seen=0.7503 , h=0.5936\n",
      "____________________________________________________________________________________________________\n",
      "episode: 384000 loss tensor(0., device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.5563375544751137\n",
      "gzsl: unseen=0.4705 , seen=0.7383 , h=0.5747\n",
      "____________________________________________________________________________________________________\n",
      "episode: 385000 loss tensor(0., device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.5852675905868795\n",
      "gzsl: unseen=0.4590 , seen=0.7322 , h=0.5643\n",
      "____________________________________________________________________________________________________\n",
      "episode: 386000 loss tensor(0., device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.5761821501357313\n",
      "gzsl: unseen=0.5047 , seen=0.7374 , h=0.5992\n",
      "____________________________________________________________________________________________________\n",
      "episode: 387000 loss tensor(0., device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.5982070065226287\n",
      "gzsl: unseen=0.5047 , seen=0.7506 , h=0.6036\n",
      "____________________________________________________________________________________________________\n",
      "episode: 388000 loss tensor(0., device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.5979074333368048\n",
      "gzsl: unseen=0.5078 , seen=0.7407 , h=0.6026\n",
      "____________________________________________________________________________________________________\n",
      "episode: 389000 loss tensor(0., device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.6109090033270632\n",
      "gzsl: unseen=0.5015 , seen=0.7558 , h=0.6029\n",
      "____________________________________________________________________________________________________\n",
      "episode: 390000 loss tensor(0., device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.6043494687207546\n",
      "gzsl: unseen=0.4872 , seen=0.7546 , h=0.5921\n",
      "____________________________________________________________________________________________________\n",
      "episode: 391000 loss tensor(0., device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.6140779728140486\n",
      "gzsl: unseen=0.4932 , seen=0.7513 , h=0.5955\n",
      "____________________________________________________________________________________________________\n",
      "episode: 392000 loss tensor(0., device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.6063267560019969\n",
      "gzsl: unseen=0.4870 , seen=0.7458 , h=0.5893\n",
      "____________________________________________________________________________________________________\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "episode: 393000 loss tensor(0., device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.6156477382949934\n",
      "gzsl: unseen=0.5047 , seen=0.7527 , h=0.6043\n",
      "____________________________________________________________________________________________________\n",
      "episode: 394000 loss tensor(0., device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.6170813069089799\n",
      "gzsl: unseen=0.5062 , seen=0.7516 , h=0.6050\n",
      "____________________________________________________________________________________________________\n",
      "episode: 395000 loss tensor(0., device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.6223791363732468\n",
      "gzsl: unseen=0.5123 , seen=0.7547 , h=0.6103\n",
      "____________________________________________________________________________________________________\n",
      "episode: 396000 loss tensor(0., device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.6146322187958538\n",
      "gzsl: unseen=0.4963 , seen=0.7527 , h=0.5982\n",
      "____________________________________________________________________________________________________\n",
      "episode: 397000 loss tensor(0., device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.6125043915464842\n",
      "gzsl: unseen=0.5136 , seen=0.7561 , h=0.6117\n",
      "____________________________________________________________________________________________________\n",
      "episode: 398000 loss tensor(0., device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.6138315472714475\n",
      "gzsl: unseen=0.4711 , seen=0.7558 , h=0.5805\n",
      "____________________________________________________________________________________________________\n",
      "episode: 399000 loss tensor(0., device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.6153299710959288\n",
      "gzsl: unseen=0.4758 , seen=0.7649 , h=0.5867\n",
      "____________________________________________________________________________________________________\n",
      "episode: 400000 loss tensor(0., device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.6232424693365238\n",
      "gzsl: unseen=0.4922 , seen=0.7653 , h=0.5991\n",
      "____________________________________________________________________________________________________\n",
      "episode: 401000 loss tensor(0., device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.6196000937227404\n",
      "gzsl: unseen=0.5078 , seen=0.7648 , h=0.6104\n",
      "____________________________________________________________________________________________________\n",
      "episode: 402000 loss tensor(0., device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.6193753856268035\n",
      "gzsl: unseen=0.5061 , seen=0.7678 , h=0.6101\n",
      "____________________________________________________________________________________________________\n",
      "episode: 403000 loss tensor(0., device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.6177940380157181\n",
      "gzsl: unseen=0.5062 , seen=0.7644 , h=0.6091\n",
      "____________________________________________________________________________________________________\n",
      "episode: 404000 loss tensor(0., device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.6181502153605986\n",
      "gzsl: unseen=0.5074 , seen=0.7602 , h=0.6086\n",
      "____________________________________________________________________________________________________\n",
      "episode: 405000 loss tensor(0., device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.62050727766006\n",
      "gzsl: unseen=0.5048 , seen=0.7725 , h=0.6106\n",
      "____________________________________________________________________________________________________\n",
      "episode: 406000 loss tensor(0., device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.6147699885596346\n",
      "gzsl: unseen=0.5135 , seen=0.7583 , h=0.6124\n",
      "____________________________________________________________________________________________________\n",
      "episode: 407000 loss tensor(0., device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.6261057090082256\n",
      "gzsl: unseen=0.4971 , seen=0.7595 , h=0.6009\n",
      "____________________________________________________________________________________________________\n",
      "episode: 408000 loss tensor(0., device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.6147113155616346\n",
      "gzsl: unseen=0.5098 , seen=0.7559 , h=0.6089\n",
      "____________________________________________________________________________________________________\n",
      "episode: 409000 loss tensor(0., device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.6236416492846656\n",
      "gzsl: unseen=0.5330 , seen=0.7533 , h=0.6242\n",
      "____________________________________________________________________________________________________\n",
      "episode: 410000 loss tensor(0., device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.6162629959051893\n",
      "gzsl: unseen=0.5312 , seen=0.7518 , h=0.6226\n",
      "____________________________________________________________________________________________________\n",
      "episode: 411000 loss tensor(0., device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.6204352554436584\n",
      "gzsl: unseen=0.5314 , seen=0.7492 , h=0.6218\n",
      "____________________________________________________________________________________________________\n",
      "episode: 412000 loss tensor(0., device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.6287022594147864\n",
      "gzsl: unseen=0.5212 , seen=0.7551 , h=0.6167\n",
      "____________________________________________________________________________________________________\n",
      "episode: 413000 loss tensor(0., device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.6184532550838113\n",
      "gzsl: unseen=0.5135 , seen=0.7560 , h=0.6116\n",
      "____________________________________________________________________________________________________\n",
      "episode: 414000 loss tensor(0., device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.6278709210440283\n",
      "gzsl: unseen=0.5221 , seen=0.7541 , h=0.6170\n",
      "____________________________________________________________________________________________________\n",
      "episode: 415000 loss tensor(0., device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.6218158122185576\n",
      "gzsl: unseen=0.5060 , seen=0.7489 , h=0.6039\n",
      "____________________________________________________________________________________________________\n",
      "episode: 416000 loss tensor(0., device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.621245455572167\n",
      "gzsl: unseen=0.5106 , seen=0.7577 , h=0.6100\n",
      "____________________________________________________________________________________________________\n",
      "episode: 417000 loss tensor(0., device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.6261078222097977\n",
      "gzsl: unseen=0.5199 , seen=0.7522 , h=0.6149\n",
      "____________________________________________________________________________________________________\n",
      "episode: 418000 loss tensor(0., device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.6163062270273112\n",
      "gzsl: unseen=0.5249 , seen=0.7546 , h=0.6191\n",
      "____________________________________________________________________________________________________\n",
      "episode: 419000 loss tensor(0., device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.6112469303475775\n",
      "gzsl: unseen=0.5049 , seen=0.7510 , h=0.6039\n",
      "____________________________________________________________________________________________________\n",
      "episode: 420000 loss tensor(0., device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.6117458547921262\n",
      "gzsl: unseen=0.5027 , seen=0.7559 , h=0.6038\n",
      "____________________________________________________________________________________________________\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "episode: 421000 loss tensor(0., device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.6100853033433777\n",
      "gzsl: unseen=0.5125 , seen=0.7506 , h=0.6091\n",
      "____________________________________________________________________________________________________\n",
      "episode: 422000 loss tensor(0., device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.6231566745002776\n",
      "gzsl: unseen=0.5099 , seen=0.7555 , h=0.6088\n",
      "____________________________________________________________________________________________________\n",
      "episode: 423000 loss tensor(0., device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.615098878287441\n",
      "gzsl: unseen=0.4957 , seen=0.7513 , h=0.5973\n",
      "____________________________________________________________________________________________________\n",
      "episode: 424000 loss tensor(0., device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.6147916225067372\n",
      "gzsl: unseen=0.5020 , seen=0.7510 , h=0.6018\n",
      "____________________________________________________________________________________________________\n",
      "episode: 425000 loss tensor(0., device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.6133959825746296\n",
      "gzsl: unseen=0.4973 , seen=0.7498 , h=0.5980\n",
      "____________________________________________________________________________________________________\n",
      "episode: 426000 loss tensor(0., device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.6207198026742088\n",
      "gzsl: unseen=0.5049 , seen=0.7599 , h=0.6067\n",
      "____________________________________________________________________________________________________\n",
      "episode: 427000 loss tensor(0.0009, device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.6215846813459917\n",
      "gzsl: unseen=0.5133 , seen=0.7565 , h=0.6117\n",
      "____________________________________________________________________________________________________\n",
      "episode: 428000 loss tensor(0., device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.6271177410173899\n",
      "gzsl: unseen=0.5095 , seen=0.7494 , h=0.6066\n",
      "____________________________________________________________________________________________________\n",
      "episode: 429000 loss tensor(0., device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.6299499507059794\n",
      "gzsl: unseen=0.5168 , seen=0.7528 , h=0.6129\n",
      "____________________________________________________________________________________________________\n",
      "episode: 430000 loss tensor(0., device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.6255441498230867\n",
      "gzsl: unseen=0.5191 , seen=0.7577 , h=0.6161\n",
      "____________________________________________________________________________________________________\n",
      "episode: 431000 loss tensor(0., device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.624855644992629\n",
      "gzsl: unseen=0.5076 , seen=0.7557 , h=0.6073\n",
      "____________________________________________________________________________________________________\n",
      "episode: 432000 loss tensor(0., device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.6020494026363302\n",
      "gzsl: unseen=0.5204 , seen=0.7502 , h=0.6145\n",
      "____________________________________________________________________________________________________\n",
      "episode: 433000 loss tensor(0., device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.6209133844709148\n",
      "gzsl: unseen=0.5210 , seen=0.7590 , h=0.6178\n",
      "____________________________________________________________________________________________________\n",
      "episode: 434000 loss tensor(0., device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.6218310231419357\n",
      "gzsl: unseen=0.5216 , seen=0.7586 , h=0.6181\n",
      "____________________________________________________________________________________________________\n",
      "episode: 435000 loss tensor(0., device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.6022283802491388\n",
      "gzsl: unseen=0.5164 , seen=0.7428 , h=0.6092\n",
      "____________________________________________________________________________________________________\n",
      "episode: 436000 loss tensor(0., device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.6058762927594048\n",
      "gzsl: unseen=0.5140 , seen=0.7569 , h=0.6122\n",
      "____________________________________________________________________________________________________\n",
      "episode: 437000 loss tensor(0., device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.6081493019280949\n",
      "gzsl: unseen=0.5214 , seen=0.7494 , h=0.6150\n",
      "____________________________________________________________________________________________________\n",
      "episode: 438000 loss tensor(0., device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.6031137541433704\n",
      "gzsl: unseen=0.4995 , seen=0.7555 , h=0.6014\n",
      "____________________________________________________________________________________________________\n",
      "episode: 439000 loss tensor(0., device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.6136720840822372\n",
      "gzsl: unseen=0.5147 , seen=0.7479 , h=0.6098\n",
      "____________________________________________________________________________________________________\n",
      "episode: 440000 loss tensor(0., device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.6065861727044378\n",
      "gzsl: unseen=0.5207 , seen=0.7526 , h=0.6156\n",
      "____________________________________________________________________________________________________\n",
      "episode: 441000 loss tensor(0., device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.6106412107982946\n",
      "gzsl: unseen=0.5176 , seen=0.7493 , h=0.6123\n",
      "____________________________________________________________________________________________________\n",
      "episode: 442000 loss tensor(0., device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.6145005687934264\n",
      "gzsl: unseen=0.5161 , seen=0.7572 , h=0.6138\n",
      "____________________________________________________________________________________________________\n",
      "episode: 443000 loss tensor(0., device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.6049293521238609\n",
      "gzsl: unseen=0.5134 , seen=0.7525 , h=0.6104\n",
      "____________________________________________________________________________________________________\n",
      "episode: 444000 loss tensor(0., device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.6135870215567679\n",
      "gzsl: unseen=0.5312 , seen=0.7491 , h=0.6216\n",
      "____________________________________________________________________________________________________\n",
      "episode: 445000 loss tensor(0., device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.6047412268308918\n",
      "gzsl: unseen=0.5243 , seen=0.7469 , h=0.6161\n",
      "____________________________________________________________________________________________________\n",
      "episode: 446000 loss tensor(0., device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.6141586323464997\n",
      "gzsl: unseen=0.5291 , seen=0.7480 , h=0.6198\n",
      "____________________________________________________________________________________________________\n",
      "episode: 447000 loss tensor(0., device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.6082336481692263\n",
      "gzsl: unseen=0.5244 , seen=0.7436 , h=0.6150\n",
      "____________________________________________________________________________________________________\n",
      "episode: 448000 loss tensor(0., device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.6177154186481454\n",
      "gzsl: unseen=0.5396 , seen=0.7477 , h=0.6268\n",
      "____________________________________________________________________________________________________\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "episode: 449000 loss tensor(0., device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.6165916728918861\n",
      "gzsl: unseen=0.5349 , seen=0.7435 , h=0.6222\n",
      "____________________________________________________________________________________________________\n",
      "episode: 450000 loss tensor(0., device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.6142370325654828\n",
      "gzsl: unseen=0.5214 , seen=0.7428 , h=0.6127\n",
      "____________________________________________________________________________________________________\n",
      "episode: 451000 loss tensor(0., device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.6127862751148749\n",
      "gzsl: unseen=0.5115 , seen=0.7418 , h=0.6055\n",
      "____________________________________________________________________________________________________\n",
      "episode: 452000 loss tensor(0., device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.6164044208248833\n",
      "gzsl: unseen=0.5270 , seen=0.7393 , h=0.6154\n",
      "____________________________________________________________________________________________________\n",
      "episode: 453000 loss tensor(0., device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.6093461247078988\n",
      "gzsl: unseen=0.5252 , seen=0.7489 , h=0.6174\n",
      "____________________________________________________________________________________________________\n",
      "episode: 454000 loss tensor(0., device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.6214157819508029\n",
      "gzsl: unseen=0.5359 , seen=0.7386 , h=0.6211\n",
      "____________________________________________________________________________________________________\n",
      "episode: 455000 loss tensor(0., device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.6204875812725992\n",
      "gzsl: unseen=0.5337 , seen=0.7393 , h=0.6199\n",
      "____________________________________________________________________________________________________\n",
      "episode: 456000 loss tensor(0., device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.6191857871329439\n",
      "gzsl: unseen=0.5396 , seen=0.7469 , h=0.6265\n",
      "____________________________________________________________________________________________________\n",
      "episode: 457000 loss tensor(0., device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.6100872303272377\n",
      "gzsl: unseen=0.5204 , seen=0.7446 , h=0.6127\n",
      "____________________________________________________________________________________________________\n",
      "episode: 458000 loss tensor(0., device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.6091035616889725\n",
      "gzsl: unseen=0.5288 , seen=0.7410 , h=0.6172\n",
      "____________________________________________________________________________________________________\n",
      "episode: 459000 loss tensor(0., device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.613368513923122\n",
      "gzsl: unseen=0.5260 , seen=0.7405 , h=0.6151\n",
      "____________________________________________________________________________________________________\n",
      "episode: 460000 loss tensor(0., device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.6058183567531825\n",
      "gzsl: unseen=0.5127 , seen=0.7482 , h=0.6085\n",
      "____________________________________________________________________________________________________\n",
      "episode: 461000 loss tensor(0., device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.6095440974458735\n",
      "gzsl: unseen=0.5246 , seen=0.7438 , h=0.6153\n",
      "____________________________________________________________________________________________________\n",
      "episode: 462000 loss tensor(0., device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.6096291749890839\n",
      "gzsl: unseen=0.5167 , seen=0.7408 , h=0.6088\n",
      "____________________________________________________________________________________________________\n",
      "episode: 463000 loss tensor(0., device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.5976705923589417\n",
      "gzsl: unseen=0.5050 , seen=0.7310 , h=0.5973\n",
      "____________________________________________________________________________________________________\n",
      "episode: 464000 loss tensor(0., device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.5968814375422513\n",
      "gzsl: unseen=0.5167 , seen=0.7428 , h=0.6095\n",
      "____________________________________________________________________________________________________\n",
      "episode: 465000 loss tensor(0., device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.6043541492903571\n",
      "gzsl: unseen=0.5104 , seen=0.7434 , h=0.6053\n",
      "____________________________________________________________________________________________________\n",
      "episode: 466000 loss tensor(0., device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.6057991353803657\n",
      "gzsl: unseen=0.5176 , seen=0.7497 , h=0.6124\n",
      "____________________________________________________________________________________________________\n",
      "episode: 467000 loss tensor(0., device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.5921550237546377\n",
      "gzsl: unseen=0.4945 , seen=0.7507 , h=0.5962\n",
      "____________________________________________________________________________________________________\n",
      "episode: 468000 loss tensor(0.0197, device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.5930448200379305\n",
      "gzsl: unseen=0.5021 , seen=0.7455 , h=0.6000\n",
      "____________________________________________________________________________________________________\n",
      "episode: 469000 loss tensor(0., device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.5959515710528983\n",
      "gzsl: unseen=0.5059 , seen=0.7509 , h=0.6045\n",
      "____________________________________________________________________________________________________\n",
      "episode: 470000 loss tensor(0., device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.5966197764079088\n",
      "gzsl: unseen=0.5007 , seen=0.7468 , h=0.5995\n",
      "____________________________________________________________________________________________________\n",
      "episode: 471000 loss tensor(0., device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.5910030292442638\n",
      "gzsl: unseen=0.4905 , seen=0.7487 , h=0.5927\n",
      "____________________________________________________________________________________________________\n",
      "episode: 472000 loss tensor(0., device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.5911060431572777\n",
      "gzsl: unseen=0.5063 , seen=0.7418 , h=0.6018\n",
      "____________________________________________________________________________________________________\n",
      "episode: 473000 loss tensor(0., device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.5877562327246244\n",
      "gzsl: unseen=0.5067 , seen=0.7534 , h=0.6059\n",
      "____________________________________________________________________________________________________\n",
      "episode: 474000 loss tensor(0., device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.5868805273934251\n",
      "gzsl: unseen=0.5133 , seen=0.7466 , h=0.6084\n",
      "____________________________________________________________________________________________________\n",
      "episode: 475000 loss tensor(0., device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.5948616246394238\n",
      "gzsl: unseen=0.5156 , seen=0.7437 , h=0.6090\n",
      "____________________________________________________________________________________________________\n",
      "episode: 476000 loss tensor(0., device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.593244045679593\n",
      "gzsl: unseen=0.5049 , seen=0.7452 , h=0.6020\n",
      "____________________________________________________________________________________________________\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "episode: 477000 loss tensor(0., device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.6072495514014455\n",
      "gzsl: unseen=0.5158 , seen=0.7486 , h=0.6108\n",
      "____________________________________________________________________________________________________\n",
      "episode: 478000 loss tensor(0., device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.5976969399439792\n",
      "gzsl: unseen=0.4970 , seen=0.7513 , h=0.5983\n",
      "____________________________________________________________________________________________________\n",
      "episode: 479000 loss tensor(0., device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.5907977030269131\n",
      "gzsl: unseen=0.5067 , seen=0.7446 , h=0.6030\n",
      "____________________________________________________________________________________________________\n",
      "episode: 480000 loss tensor(0., device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.5853076812165299\n",
      "gzsl: unseen=0.4951 , seen=0.7498 , h=0.5964\n",
      "____________________________________________________________________________________________________\n",
      "episode: 481000 loss tensor(0., device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.584481353532608\n",
      "gzsl: unseen=0.4914 , seen=0.7449 , h=0.5921\n",
      "____________________________________________________________________________________________________\n",
      "episode: 482000 loss tensor(0., device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.5864943128391552\n",
      "gzsl: unseen=0.4929 , seen=0.7438 , h=0.5929\n",
      "____________________________________________________________________________________________________\n",
      "episode: 483000 loss tensor(0., device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.5775881296214324\n",
      "gzsl: unseen=0.4837 , seen=0.7414 , h=0.5854\n",
      "____________________________________________________________________________________________________\n",
      "episode: 484000 loss tensor(0., device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.5737916856949444\n",
      "gzsl: unseen=0.4879 , seen=0.7333 , h=0.5859\n",
      "____________________________________________________________________________________________________\n",
      "episode: 485000 loss tensor(0., device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.5899854163916065\n",
      "gzsl: unseen=0.4939 , seen=0.7399 , h=0.5924\n",
      "____________________________________________________________________________________________________\n",
      "episode: 486000 loss tensor(0., device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.5769012993980117\n",
      "gzsl: unseen=0.4891 , seen=0.7411 , h=0.5893\n",
      "____________________________________________________________________________________________________\n",
      "episode: 487000 loss tensor(0., device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.5806249234676981\n",
      "gzsl: unseen=0.4880 , seen=0.7524 , h=0.5920\n",
      "____________________________________________________________________________________________________\n",
      "episode: 488000 loss tensor(0., device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.5844971097573479\n",
      "gzsl: unseen=0.4868 , seen=0.7389 , h=0.5869\n",
      "____________________________________________________________________________________________________\n",
      "episode: 489000 loss tensor(0., device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.5736783455765979\n",
      "gzsl: unseen=0.4819 , seen=0.7346 , h=0.5820\n",
      "____________________________________________________________________________________________________\n",
      "episode: 490000 loss tensor(0., device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.5804696364503641\n",
      "gzsl: unseen=0.4907 , seen=0.7334 , h=0.5880\n",
      "____________________________________________________________________________________________________\n",
      "episode: 491000 loss tensor(0., device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.5775975730403539\n",
      "gzsl: unseen=0.4884 , seen=0.7329 , h=0.5862\n",
      "____________________________________________________________________________________________________\n",
      "episode: 492000 loss tensor(0., device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.5915434218714369\n",
      "gzsl: unseen=0.5010 , seen=0.7439 , h=0.5988\n",
      "____________________________________________________________________________________________________\n",
      "episode: 493000 loss tensor(0., device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.5794906192421059\n",
      "gzsl: unseen=0.4963 , seen=0.7370 , h=0.5932\n",
      "____________________________________________________________________________________________________\n",
      "episode: 494000 loss tensor(0., device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.5867298252085146\n",
      "gzsl: unseen=0.5018 , seen=0.7456 , h=0.5999\n",
      "____________________________________________________________________________________________________\n",
      "episode: 495000 loss tensor(0., device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.5671367483181826\n",
      "gzsl: unseen=0.4682 , seen=0.7444 , h=0.5748\n",
      "____________________________________________________________________________________________________\n",
      "episode: 496000 loss tensor(0., device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.5760601375410257\n",
      "gzsl: unseen=0.4835 , seen=0.7408 , h=0.5851\n",
      "____________________________________________________________________________________________________\n",
      "episode: 497000 loss tensor(0., device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.577378217962708\n",
      "gzsl: unseen=0.4801 , seen=0.7482 , h=0.5849\n",
      "____________________________________________________________________________________________________\n",
      "episode: 498000 loss tensor(0., device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.5816651349346194\n",
      "gzsl: unseen=0.4716 , seen=0.7544 , h=0.5804\n",
      "____________________________________________________________________________________________________\n",
      "episode: 499000 loss tensor(0., device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.5736368113828203\n",
      "gzsl: unseen=0.4614 , seen=0.7635 , h=0.5752\n",
      "____________________________________________________________________________________________________\n",
      "episode: 500000 loss tensor(0., device='cuda:0', grad_fn=<AddBackward0>)\n",
      "Testing...\n",
      "class num: 10\n",
      "class num: 50\n",
      "class num: 50\n",
      "zsl: 0.5804276155146839\n",
      "gzsl: unseen=0.4777 , seen=0.7614 , h=0.5871\n",
      "____________________________________________________________________________________________________\n"
     ]
    }
   ],
   "source": [
    "print(\"training...\")\n",
    "last_accuracy = 0.0\n",
    "writer = SummaryWriter()\n",
    "for episode in range(EPISODE):\n",
    "    #attribute_network.train()\n",
    "    triplet_network_scheduler.step(episode)\n",
    "    attribute_network_scheduler.step(episode)\n",
    "    \n",
    "\n",
    "    train_loader = DataLoader(train_data, batch_size=BATCH_SIZE, shuffle=True)\n",
    "\n",
    "    batch_labels, batch_features = train_loader.__iter__().next()\n",
    "    \n",
    "    batch_features_negative = np.empty_like(batch_features.numpy())\n",
    "    \n",
    "    \n",
    "    batch_attributes = torch.Tensor([all_attributes[i] for i in batch_labels.numpy()]).squeeze(1)\n",
    "    batch_attributes_negative = torch.empty_like(batch_attributes)\n",
    "    \n",
    "    \n",
    "    \n",
    "    for i in range(batch_features_negative.shape[0]):\n",
    "        pick=np.random.choice(np.where(batch_labels.numpy()!=batch_labels.numpy()[i])[0], replace=True)\n",
    "        batch_features_negative[i] = batch_features[pick]\n",
    "    \n",
    "    \n",
    "    batch_features_negative = torch.from_numpy(batch_features_negative)\n",
    "    batch_features_negative = Variable(batch_features_negative).cuda(GPU).float()  # 32*2048\n",
    "    \n",
    "    \n",
    "    \n",
    "    for i in range(batch_attributes_negative.size()[0]):\n",
    "        pick=np.random.choice(np.where(batch_labels.numpy()!=batch_labels.numpy()[i])[0], replace=True)\n",
    "        batch_attributes_negative[i] = batch_attributes[pick]\n",
    "    \n",
    "    \n",
    "    #print(batch_attributes.size())\n",
    "    #print(batch_attributes_negative.size())\n",
    "    \n",
    "    \n",
    "    #batch_attributes_negative = torch.from_numpy(batch_features_negative)\n",
    "    batch_attributes_negative = Variable(batch_attributes_negative).cuda(GPU).float()  # 32*2048\n",
    "    batch_attributes = Variable(batch_attributes).cuda(GPU)\n",
    "    #batch_attributes = attribute_network(Variable(batch_attributes).cuda(GPU))\n",
    "    batch_features = Variable(batch_features).cuda(GPU).float()  # 32*2048\n",
    "    #print((batch_attributes_negative).size())\n",
    "    #print(attribute_network(batch_attributes_negative).size())\n",
    "    \n",
    "    dista, distb, embedded_x, embedded_y, embedded_z = triplet_network(attribute_network(batch_attributes), batch_features, batch_features_negative)\n",
    "    dista2, distb2, embedded_x2, embedded_y2, embedded_z2 = triplet_network(batch_features,\n",
    "                                                                            attribute_network(batch_attributes), \n",
    "                                                                            attribute_network(batch_attributes_negative))\n",
    "    \n",
    "    criterion = nn.MarginRankingLoss(margin = Margin).cuda(GPU)\n",
    "    \n",
    "    target = torch.FloatTensor(dista.size()).fill_(-1).cuda(GPU)\n",
    "    \n",
    "    \n",
    "    loss_triplet= criterion(dista, distb, target) + criterion(dista2, distb2, target)\n",
    "    loss_embedd = embedded_x.norm(2) + embedded_y.norm(2) + embedded_z.norm(2)\n",
    "    loss = loss_triplet #+ Nom * loss_embedd\n",
    "\n",
    "    # update\n",
    "    triplet_network.zero_grad()\n",
    "    attribute_network.zero_grad()\n",
    "    metric_network.zero_grad()\n",
    "    loss.backward()\n",
    "    triplet_network_optim.step()\n",
    "    attribute_network_optim.step()\n",
    "    \n",
    "    \n",
    "    if (episode+1)%1000 == 0:\n",
    "        print(\"episode:\", episode+1, \"loss\", loss)\n",
    "        writer.add_scalar('data/loss', loss, episode)\n",
    "    if (episode+1)%1000 == 0:\n",
    "        print(\"Testing...\")\n",
    "        #attribute_network.eval()\n",
    "        zsl_accuracy = compute_accuracy_per_class(test_features, test_label, test_id, test_attributes)\n",
    "        gzsl_unseen_accuracy = compute_accuracy_per_class(test_features, test_label, np.arange(50), attributes)\n",
    "        gzsl_seen_accuracy = compute_accuracy_per_class(test_seen_features, test_seen_label, np.arange(50), attributes)\n",
    "        H = 2 * gzsl_seen_accuracy * gzsl_unseen_accuracy / (gzsl_unseen_accuracy + gzsl_seen_accuracy)\n",
    "        print('zsl:', zsl_accuracy)\n",
    "        print('gzsl: unseen=%.4f , seen=%.4f , h=%.4f' % (gzsl_unseen_accuracy , gzsl_seen_accuracy, H))\n",
    "        print('_'*100)\n",
    "        writer.add_scalar('data/zsl_accuracy', zsl_accuracy, episode)\n",
    "        writer.add_scalar('data/gzsl_unseen_accuracy', gzsl_unseen_accuracy, episode)\n",
    "        writer.add_scalar('data/gzsl_seen_accuracy', gzsl_seen_accuracy, episode)\n",
    "        writer.add_scalar('data/H', H, episode)\n",
    "writer.export_scalars_to_json(\"./test.json\")\n",
    "writer.close()\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "hide_input": false,
  "kernelspec": {
   "display_name": "pytorch",
   "language": "python",
   "name": "pytorch"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.5.5"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
